/**
 * Song Analyzer - Dark Futuristic Stylesheet
 */

/* CSS Variables - Warm Vintage Vinyl Theme */
:root {
    /* Background Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #151933;
    --bg-tertiary: #1e2340;

    /* Warm Vintage Accents: Burnt Orange → Wine Red */
    --accent-primary: #ff6b35;
    --accent-secondary: #8b1538;
    --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #8b1538 100%);

    /* Metallic Gradients for Sophisticated Look */
    --metallic-rose-gold: linear-gradient(135deg, #e6b89c 0%, #d4a59a 50%, #c9797e 100%);
    --metallic-chrome: linear-gradient(135deg, #e8e8e8 0%, #b8b8b8 50%, #9a9a9a 100%);
    --metallic-warm: linear-gradient(135deg, #ffb347 0%, #ff6b35 50%, #d84315 100%);

    /* Accent Variations */
    --accent-light: #ff8c5a;
    --accent-dark: #6d0f2e;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #6c7a8e;

    /* UI Colors */
    --border-color: #2a3150;
    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff4444;
    --shadow: rgba(0, 0, 0, 0.5);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1.125rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 600px;
}

/* Header */
header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 50px;
    margin-top: 10px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.5rem;
    border-radius: 8px;
}

.lang-switch a {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-switch a.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
}

/* Free Analysis Display */
.free-analysis-display {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.free-analysis-display span {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Credits Display */
.credits-display {
    display: flex;
    align-items: center;
}

.credits-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    color: var(--accent-primary);
}

.credits-link:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.credits-link svg {
    color: var(--accent-primary);
}

/* Language Menu with Dropdown */
.lang-menu {
    position: relative;
}

.lang-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-icon:hover {
    background: var(--bg-secondary);
    transform: scale(1.05);
}

.lang-icon svg {
    color: var(--text-secondary);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 150px;
    box-shadow: 0 8px 30px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.lang-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.lang-dropdown a.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    font-weight: 700;
    font-size: 1.125rem;
}

.user-icon:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 150px;
    display: none;
    box-shadow: 0 10px 30px var(--shadow);
}

.user-dropdown.active {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.user-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

footer .footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

footer nav {
    display: flex;
    gap: 2rem;
}

footer nav a {
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
}

footer nav a:hover {
    color: var(--accent-primary);
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 0;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

textarea {
    resize: vertical;
    min-height: 150px;
}

input[type="file"] {
    padding: 0.75rem;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
}

/* Honeypot field (hidden spam prevention) */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 1rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-pending {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.badge-running {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-primary);
}

.badge-partial {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-primary);
}

.badge-complete {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.badge-error {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error);
}

.badge-primary {
    background: rgba(102, 126, 234, 0.2);
    color: var(--accent-primary);
}

.badge-secondary {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Loading Spinner */
.spinner {
    border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }

    footer nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
    }

    .card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .free-analysis-display {
        margin-right: 0.5rem;
    }

    .free-analysis-display span {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .header-nav {
        gap: 0.75rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}

/* Social Login Styles */
.social-login {
    margin-top: 2rem;
}

.social-login-title {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* Google Sign-In Button Container */
.g_id_signin {
    margin-bottom: 0.75rem;
}

/* Social Buttons */
.social-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.social-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.social-btn:active {
    transform: translateY(0);
}

/* Apple Button Specific Styles */
.social-btn-apple {
    background: #000000;
    border-color: #000000;
}

.social-btn-apple:hover {
    background: #1a1a1a;
    border-color: #ffffff;
}

#appleid-signin {
    margin-bottom: 0.75rem;
}

/* TikTok Button Specific Styles */
.social-btn-tiktok {
    background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
    border: none;
    color: #ffffff;
}

.social-btn-tiktok:hover {
    background: linear-gradient(135deg, #00d4d4 0%, #e60048 100%);
    border: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 80, 0.4);
}

.social-btn-tiktok svg {
    flex-shrink: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0 1.5rem 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive adjustments for social buttons */
@media (max-width: 480px) {
    .social-btn {
        padding: 0.65rem 0.875rem;
        font-size: 0.9375rem;
    }

    .social-login-title {
        font-size: 0.8125rem;
    }
}

/* ========================================
   Warm Vintage Metallic Enhancements
   ======================================== */

/* Logo with Rose Gold Metallic */
.logo {
    background: var(--metallic-rose-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Warm Glow Animation */
@keyframes warmGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
    }
}

/* Enhanced Button Shadows */
.btn-primary {
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

/* Enhanced Card Hover Effects */
.card:hover {
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.2);
}

/* User Icon Gradient */
.user-icon {
    background: var(--accent-gradient);
}

/* Credits Link Enhancement */
.credits-link {
    color: var(--accent-primary);
}

.credits-link svg {
    color: var(--accent-primary);
}

/* Badge Enhancements */
.badge-running,
.badge-partial {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-primary);
}

.badge-primary {
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-primary);
}

/* Link Hover States */
a:hover {
    color: var(--accent-light);
}

/* Focus States with Warm Glow */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

/* Checkbox Accent */
input[type="checkbox"] {
    accent-color: var(--accent-primary);
}

/* Alert Success with Warm Tones */
.alert-success {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-light);
}

/* Enhanced Table Row Hover */
tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

/* Metallic Text Highlights */
h1 {
    background: var(--metallic-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
