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

:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0d1b2a;
    --bg-card: rgba(22, 36, 71, 0.8);
    --card-bg: rgba(22, 36, 71, 0.9);
    --card-border: rgba(0, 217, 255, 0.2);
    --text-primary: #e0e0e0;
    --text-secondary: #aaa;
    --accent: #00D9FF;
    --border: rgba(0, 217, 255, 0.2);
    --hover-bg: rgba(22, 36, 71, 0.95);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-text: #fff;
}

html[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #e8ecf1;
    --bg-card: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: rgba(0, 128, 255, 0.2);
    --text-primary: #1a1a1a;
    --text-secondary: #555;
    --accent: #0080ff;
    --border: rgba(0, 128, 255, 0.3);
    --hover-bg: rgba(240, 244, 248, 0.95);
    --input-bg: #ffffff;
    --input-border: #d0d0d0;
    --input-text: #1a1a1a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: linear-gradient(90deg, var(--bg-primary) 0%, #162447 100%);
    color: var(--text-primary);
    padding: 1rem 0;
    box-shadow: 0 2px 8px var(--border);
    border-bottom: 1px solid var(--border);
}

html[data-theme="light"] .navbar {
    background: linear-gradient(90deg, #ffffff 0%, #f0f4f8 100%);
    box-shadow: 0 2px 8px rgba(0, 128, 255, 0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

html[data-theme="light"] .logo {
    color: #1a1a1a;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.3));
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

html[data-theme="light"] .nav-links a {
    color: #1a1a1a;
}

.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.theme-icon {
    display: block;
    line-height: 1;
}

main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(0, 217, 255, 0.15);
    color: #00D9FF;
    border-color: rgba(0, 217, 255, 0.3);
}

.alert-error {
    background-color: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
    border-color: rgba(255, 107, 107, 0.3);
}

.alert-warning {
    background-color: rgba(255, 184, 34, 0.15);
    color: #FFB822;
    border-color: rgba(255, 184, 34, 0.3);
}

.alert-info {
    background-color: rgba(176, 38, 255, 0.15);
    color: #B026FF;
    border-color: rgba(176, 38, 255, 0.3);
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--border);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: background 0.3s ease;
}

html[data-theme="light"] .card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #00D9FF 0%, #00CED1 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00CED1 0%, #00B8D4 100%);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #B026FF 0%, #8E2DE2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(176, 38, 255, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #8E2DE2 0%, #7B1FA2 100%);
    box-shadow: 0 6px 20px rgba(176, 38, 255, 0.4);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

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

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 217, 255, 0.2);
    width: 100%;
    text-align: center;
}

html[data-theme="light"] .auth-card {
    box-shadow: 0 12px 40px rgba(0, 128, 255, 0.15);
}

.auth-card .auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.auth-card .auth-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(0, 217, 255, 0.4));
}

.auth-card .auth-logo span {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}

.auth-card h1 {
    margin-bottom: 2rem;
    color: var(--accent);
    font-size: 1.8rem;
}

.theme-toggle-floating {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.theme-toggle-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.3);
}

.auth-card form {
    text-align: left;
}

.auth-card .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-links {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.auth-links a:hover {
    opacity: 0.8;
}

.social-login {
    margin-top: 2rem;
}

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

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

.divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.form-group label,
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

html[data-theme="light"] .form-group label,
html[data-theme="light"] label {
    color: #1a1a1a;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--input-text);
    transition: all 0.3s;
}

html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] input,
html[data-theme="light"] select {
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #d0d0d0;
}

.form-group input:focus,
.form-group select:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: rgba(128, 128, 128, 0.2);
    border-color: rgba(128, 128, 128, 0.3);
}

html[data-theme="light"] select:disabled {
    background: rgba(200, 200, 200, 0.3);
    border-color: rgba(180, 180, 180, 0.5);
}

html[data-theme="light"] .form-group input:focus,
html[data-theme="light"] .form-group select:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus {
    box-shadow: 0 0 0 3px rgba(0, 128, 255, 0.1);
}

/* Make sure select dropdowns have proper option colors */
select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

html[data-theme="light"] select option {
    background: #ffffff;
    color: #1a1a1a;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #00D9FF;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.social-login {
    margin-top: 2rem;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #6c757d;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-google:hover {
    background: var(--hover-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

html[data-theme="light"] .btn-google {
    background: white;
    color: #444;
}

html[data-theme="light"] .btn-google:hover {
    background: #f8f9fa;
}

.btn-google svg {
    flex-shrink: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00D9FF;
    margin-top: 0.5rem;
}

.status-success {
    color: #28a745;
    font-weight: 500;
}

.status-warning {
    color: #ffc107;
    font-weight: 500;
}

.status-completed {
    color: #28a745;
}

.operations-section {
    margin-top: 2rem;
}

.operation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

table th {
    background: var(--hover-bg);
    color: var(--accent);
    font-weight: 600;
}

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

.guide-container {
    max-width: 900px;
    margin: 0 auto;
}

.guide-section {
    margin-bottom: 3rem;
}

.guide-section h2 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.guide-section p {
    color: var(--text-primary);
    line-height: 1.6;
}

.guide-section ol,
.guide-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guide-section li {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.guide-section li strong {
    color: var(--accent);
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.code-block p {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.code-block code {
    font-family: 'Courier New', monospace;
    display: block;
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.9rem;
    word-break: break-all;
}

.note {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
}

.note strong,
.note p {
    color: var(--text-primary);
}

html[data-theme="light"] .note {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-left: 4px solid #fbbf24;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
}

.warning strong,
.warning p {
    color: var(--text-primary);
}

html[data-theme="light"] .warning {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.3);
}

.env-list {
    list-style-type: none;
    margin-left: 0;
}

.env-list li {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
}

.env-list code {
    color: var(--accent);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.upload-form {
    margin-top: 2rem;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    border: 2px dashed #00D9FF;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    background-color: var(--hover-bg);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.file-text {
    font-size: 1.1rem;
    color: var(--accent);
}

input[type="file"] {
    display: none;
}

.file-name {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.info-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.info-box h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-box ul {
    color: var(--text-primary);
}

.info-box p {
    color: var(--text-primary);
}

.filters-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.artist-chart-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.artist-tab {
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.artist-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.artist-tab.active {
    background: linear-gradient(135deg, #00D9FF 0%, #00CED1 100%);
    color: white;
    border-color: #00D9FF;
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.3);
}

.chart-card {
    min-height: 400px;
}

.chart-card canvas {
    max-height: 350px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--accent);
}

.info-card h2 {
    color: var(--text-primary);
}

.info-card ul {
    color: var(--text-primary);
}

.info-card p {
    color: var(--text-primary);
}

.mode-form {
    margin-top: 2rem;
}

.results-container {
    max-width: 900px;
    margin: 0 auto;
}

.success-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid #28a745;
}

.success-card h2, .success-card p, .success-card ul {
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

footer {
    background: linear-gradient(90deg, #0a1628 0%, #162447 100%);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    /* Navigation */
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-toggle {
        display: block;
        order: 3;
    }
    
    .logo {
        font-size: 1.2rem;
        gap: 0.5rem;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        order: 4;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        padding: 0.75rem;
        background: var(--bg-secondary);
        border-radius: 8px;
        text-align: center;
    }
    
    /* Container padding */
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Cards */
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    /* Grids */
    .dashboard-grid,
    .operation-cards,
    .analytics-grid,
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Tables */
    table {
        font-size: 0.85rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Forms */
    .form-group input,
    .form-group select {
        font-size: 16px;
    }
    
    /* Footer */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
        font-size: 0.9rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 1rem;
    }
    
    /* Chat page mobile optimizations */
    .chat-page-container {
        padding: 1rem !important;
    }
    
    .chat-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem !important;
    }
    
    .chat-card {
        height: calc(100vh - 280px) !important;
        min-height: 400px;
    }
    
    .chat-messages {
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .chat-input-container {
        padding: 0.75rem !important;
    }
    
    .chat-form {
        gap: 0.5rem !important;
    }
    
    .btn-send {
        padding: 0.75rem 1rem !important;
    }
    
    .send-text {
        display: none;
    }
    
    .send-icon {
        display: inline !important;
    }
    
    .btn-clear-chat {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
    
    .clear-text {
        display: none;
    }
    
    /* User messages on mobile */
    .chat-messages > div[style*="margin-left: auto"] {
        max-width: 85% !important;
        font-size: 0.9rem;
    }
    
    /* AI messages on mobile */
    .chat-messages > div[style*="border-left: 4px solid var(--accent)"] {
        max-width: 95% !important;
        font-size: 0.9rem;
        padding: 0.75rem !important;
    }
}

/* Heading styles */
h1, h2, h3, h4, h5, h6 {
    color: var(--accent);
}

.card h1, .card h2, .card h3, .card h4 {
    color: var(--accent);
}

/* Table styles */
table {
    background: var(--card-bg);
    color: var(--text-primary);
}


/* Link colors */
a {
    color: #00D9FF;
}

a:hover {
    color: #00CED1;
}
