:root {
    --primary: #0066ff;
    --primary-dark: #0052cc;
    --white: #ffffff;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-700: #3f3f46;
    --gray-800: #27272a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --transition-fast: 150ms;
    --transition-base: 250ms;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

html {
    scroll-behavior: smooth;
}

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

header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--gray-700);
    transition: color var(--transition-fast);
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

.mobile-menu-btn.active {
    color: var(--primary);
}

.hero {
    background: var(--primary);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    opacity: 0.9;
    animation: fadeInUp 0.8s ease;
}

.hero-cta {
    animation: fadeInUp 1s ease;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin: 0.5rem;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.calc-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    background: white;
    position: relative;
    overflow: hidden;
}

.calc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

.calc-card:hover::before {
    transform: translateX(0);
}

.calc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.calc-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.calc-card p {
    color: var(--gray-700);
    font-size: 0.9rem;
}

.calculator-form {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
}

.calculator-result {
    background: var(--primary);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: bold;
}

footer {
    background: var(--gray-800);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section ul {
    list-style: none;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat {
    text-align: center;
    animation: fadeInUp 1.2s ease;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

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

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

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        gap: 0.5rem;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem;
        border-radius: 4px;
    }
    
    .nav-links a:hover {
        background: var(--gray-100);
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat {
        margin: 0 !important;
    }
    
    .calc-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .calculator-form {
        padding: 1rem;
    }
}