/* TubeSynk v2.0 — Theme: "Neon Download" */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-input: #22222f;
    --primary: #6C5CE7;
    --primary-light: #a29bfe;
    --primary-dark: #4834d4;
    --accent: #00cec9;
    --accent-light: #81ecec;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #666680;
    --border: #2a2a3a;
    --border-light: #3a3a4a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== ATIVAÇÃO ===== */
#activation-screen {
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 70%);
}

.activation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}

.activation-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.activation-header h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.activation-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.activation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.activation-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== HEADER ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.app-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-version {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
}

.status-banner.plugin-available {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: var(--success);
}

.status-banner.plugin-unavailable {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    color: var(--warning);
}

.status-icon {
    flex-shrink: 0;
}

/* URL Input */
.url-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.url-input-wrapper {
    display: flex;
    gap: 8px;
}

.url-input-wrapper input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
}

.url-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-paste {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-paste:hover {
    color: var(--primary-light);
    border-color: var(--primary);
}

.supported-sites {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.supported-sites span {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Options */
.options-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.format-selector {
    display: flex;
    gap: 8px;
}

.format-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.format-btn.active {
    background: rgba(108, 92, 231, 0.15);
    border-color: var(--primary);
    color: var(--primary-light);
}

.format-btn:hover {
    border-color: var(--primary);
}

.quality-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
}

.quality-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Download Button */
.btn-download {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary), #4834d4);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.5);
}

.btn-download:active {
    transform: scale(0.98);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Progress */
.progress-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

/* Plugin Section */
.plugin-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plugin-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.plugin-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.btn-secondary {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(0, 206, 201, 0.1);
}

.plugin-instructions {
    margin-top: 8px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.plugin-instructions h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.plugin-instructions ol {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== SETTINGS PANEL ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 101;
    transition: right 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    overflow-y: auto;
    padding: 20px;
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-item h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.settings-value {
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    word-break: break-all;
}

.settings-link {
    display: block;
    color: var(--primary-light);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 0;
    transition: color 0.2s;
}

.settings-link:hover {
    color: var(--accent);
}

.btn-small {
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.btn-small:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.btn-danger {
    width: 100%;
    padding: 14px;
    background: rgba(225, 112, 85, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
}

.btn-danger:hover {
    background: rgba(225, 112, 85, 0.2);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-empty {
    font-size: 13px;
    color: var(--text-muted);
}

.history-item {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item .h-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.history-item .h-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    z-index: 200;
    animation: toast-in 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 16px;
    }
    
    .activation-card {
        padding: 32px 24px;
    }
}
