/* ============================================
   Smartphone Price Predictor - Blue Theme
============================================ */

:root {
    /* Blue Theme Colors */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary: #0ea5e9;
    --accent: #06b6d4;
    
    /* Glass Colors */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --glass-hover: rgba(255, 255, 255, 0.06);
    
    /* Background - Dark Blue/Black */
    --bg-dark: #0a0e1a;
    --bg-gradient-1: #0f1419;
    --bg-gradient-2: #1a1f2e;
    --bg-gradient-3: #1e2433;
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: rgba(241, 245, 249, 0.7);
    --text-muted: rgba(241, 245, 249, 0.4);
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Light Mode */
[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.9);
    --bg-dark: #f8fafc;
    --bg-gradient-1: #e0f2fe;
    --bg-gradient-2: #f0f9ff;
    --bg-gradient-3: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.7);
    --text-muted: rgba(15, 23, 42, 0.5);
}

[data-theme="light"] .orb {
    opacity: 0.12;
}

[data-theme="light"] .form-group-compact select option {
    background: #ffffff;
    color: #0f172a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   ANIMATED BACKGROUND
============================================ */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    z-index: -1;
    animation: float 25s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    top: 60%;
    right: 10%;
    animation-delay: -8s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    bottom: 10%;
    left: 40%;
    animation-delay: -16s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -40px) scale(1.05); }
    50% { transform: translate(-30px, 30px) scale(0.95); }
    75% { transform: translate(30px, 15px) scale(1.02); }
}

/* ============================================
   LAYOUT
============================================ */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   NAVBAR
============================================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    stroke: var(--primary-light);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--glass-hover);
    border-color: var(--primary-light);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

/* ============================================
   GLASS CARD
============================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.glass-card:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ============================================
   CONTENT WRAPPER - TWO COLUMN LAYOUT
============================================ */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    margin-bottom: 24px;
}

/* ============================================
   FORM STYLES
============================================ */
.form-container {
    height: fit-content;
}

.card-header-main {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header-main h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-main h2 svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary-light);
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

.section-title-compact {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-compact label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group-compact input,
.form-group-compact select {
    width: 100%;
    padding: 8px 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    transition: all 0.3s ease;
}

.form-group-compact select option {
    background: var(--bg-gradient-2);
    color: var(--text-primary);
    padding: 8px;
}

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

.form-group-compact input:focus,
.form-group-compact select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
}

.submit-btn {
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    font-family: inherit;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sample-btn {
    padding: 14px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sample-btn svg {
    width: 16px;
    height: 16px;
}

.sample-btn:hover {
    background: var(--glass-hover);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

/* ============================================
   RESULTS PANEL
============================================ */
.results-panel {
    display: flex;
    flex-direction: column;
}

.placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    min-height: 300px;
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    stroke: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-card h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.placeholder-card p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 300px;
}

.result-card,
.error-card {
    text-align: center;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h2,
.error-card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.price-range {
    font-size: 24px;
    font-weight: 700;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.price-range.budget {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.price-range.lower-mid {
    background: linear-gradient(135deg, #10b981, #059669);
}

.price-range.upper-mid {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.price-range.premium {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.prediction-details {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 10px;
    margin-top: 16px;
    text-align: left;
    border: 1px solid var(--glass-border);
}

.prediction-details h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prediction-details h3 svg {
    width: 16px;
    height: 16px;
}

.prediction-details p {
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 13px;
}

.reset-btn {
    margin-top: 20px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.error-card {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.error-card h3 {
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-card h3 svg {
    width: 20px;
    height: 20px;
}

.error-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 13px;
}

.error-card .reset-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

/* ============================================
   RECOMMENDATIONS
============================================ */
.recommendations-card {
    animation: slideIn 0.5s ease;
}

.phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.phone-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.phone-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
    transform: translateY(-4px);
}

.phone-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.phone-brand {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-5g {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.phone-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.phone-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.phone-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.star { 
    color: rgba(255, 255, 255, 0.2); 
}

.star.filled { 
    color: #f59e0b; 
}

.phone-specs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.spec-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: var(--primary-light);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 1400px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .results-panel {
        order: -1;
    }
    
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .phone-grid {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 16px;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* ============================================
   LOADING ANIMATION
============================================ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}
