/* --- General Setup & Variables --- */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --container-bg: #ffffff;
    --card-bg: #f7fafc;
    --text-color-primary: #2d3748;
    --text-color-secondary: #4a5568;
    --border-color: #e2e8f0;
    --primary-color: #667eea;
    --shadow-color: rgba(0,0,0,0.1);
    --privacy-bg: #f0fff4;
    --privacy-text: #22543d;
    --link-color-footer: #4662e1;
}

[data-theme="dark"] {
    --background-gradient: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    --container-bg: #1a202c;
    --card-bg: #2d3748;
    --text-color-primary: #e2e8f0;
    --text-color-secondary: #a0aec0;
    --border-color: #4a5568;
    --primary-color: #7f9cf5;
    --shadow-color: rgba(0,0,0,0.4);
    --privacy-bg: #2d3748;
    --privacy-text: #9ae6b4;
    --link-color-footer: #7f9cf5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color-primary);
    background: var(--background-gradient);
    min-height: 100vh;
    transition: background 0.3s ease;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    background: var(--container-bg);
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

@media (min-width: 768px) {
   .container {
        max-width: 600px;
        margin: 40px auto;
        border-radius: 12px;
        box-shadow: 0 20px 40px var(--shadow-color);
        min-height: auto;
    }
}

/* --- Header & Theme Switcher --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.theme-switcher {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color-primary);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.theme-switcher:hover {
    background-color: var(--card-bg);
}
.theme-switcher svg {
    width: 20px;
    height: 20px;
}

/* --- Navigation --- */
.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--text-color-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--link-color-footer);
}

.nav a.active {
    color: var(--link-color-footer);
    font-weight: 600;
}

/* --- Dropdown Navigation --- */
.nav-item {
    position: relative;
}

.nav-dropdown {
    color: var(--text-color-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.nav-dropdown:hover {
    color: var(--primary-color);
}

.nav-dropdown.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-dropdown::after {
    content: "▼";
    font-size: 10px;
    transition: transform 0.2s ease;
}

.nav-item:hover .nav-dropdown::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    min-width: 220px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-color-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: var(--card-bg);
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-color-primary);
    line-height: 1.2;
}

.hero p {
    font-size: 16px;
    color: var(--text-color-secondary);
    margin-bottom: 20px;
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    background: var(--privacy-bg);
    color: var(--privacy-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 30px;
}

.privacy-badge::before {
    content: "🔒";
    margin-right: 8px;
}

/* --- Calculator --- */
.calculator {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    transition: background-color 0.3s ease;
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color-primary);
    font-size: 14px;
}

select, input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background: var(--container-bg);
    color: var(--text-color-primary);
    transition: border-color 0.2s ease;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.calculate-btn {
    width: 100%;
    background: var(--background-gradient);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* --- Results --- */
.results {
    display: none;
    margin-top: 30px;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.results.show {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results.green {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.results.yellow {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.results.red {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.cost-metric {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.comparison {
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.recommendation {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.recommendation-text {
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.95;
}

.cta {
    margin-top: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 14px;
}

.share-btn {
    display: inline-block;
    margin-top: 16px;
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.share-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* --- Footer --- */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-color-secondary);
    font-size: 14px;
}

.footer p {
    margin-bottom: 8px;
}

.footer a {
    color: var(--link-color-footer);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--text-color-primary);
    text-decoration: underline;
}

@media (max-width: 360px) {
   .container {
        padding: 16px;
    }
    
   .hero h1 {
        font-size: 24px;
    }
    
   .calculator {
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .nav {
        gap: 15px;
        order: -1;
        width: 100%;
        justify-content: space-between;
    }
    
    .theme-switcher {
        align-self: flex-end;
    }
    
    /* Mobile dropdown adjustments */
    .dropdown-menu {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        min-width: auto;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .nav-item:hover .dropdown-menu {
        transform: translateY(5px);
    }

}




