/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #1E3A8A;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --accent-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

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

/* ===== HEADER & NAVIGATION ===== */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary-light);
}

.logo i {
    font-size: 1.75rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero-content h2 {
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-description {
    font-size: 1.125rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.9;
    line-height: 1.8;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease 0.6s both;
}

.cta-button:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ===== CALCULATORS SECTION ===== */
.calculators-section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

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

.calculator-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--border-color);
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 2rem;
    color: white;
}

.card-icon.health { background: linear-gradient(135deg, #10b981, #059669); }
.card-icon.finance { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.card-icon.math { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.card-icon.shopping { background: linear-gradient(135deg, #f59e0b, #d97706); }
.card-icon.time { background: linear-gradient(135deg, #ec4899, #db2777); }
.card-icon.education { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.card-icon.travel { background: linear-gradient(135deg, #ef4444, #dc2626); }

.calculator-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.calculator-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.card-link:hover {
    color: var(--primary-light);
    gap: 0.75rem;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    background: var(--bg-white);
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 20px;
    font-size: 2.5rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
}

/* ===== CALCULATOR PAGE STYLES ===== */
.calculator-page {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

.calculator-header {
    text-align: center;
    margin-bottom: 3rem;
}

.calculator-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.calculator-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

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

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

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

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

.result-section {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    display: none;
}

.result-section.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.result-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.25rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ===== LEGAL PAGES ===== */
.legal-page {
    padding: 3rem 0;
}

.legal-content {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.legal-content h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.legal-content h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin: 2rem 0 1rem;
}

.legal-content h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 1.5rem 0 0.75rem;
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

.legal-content ul, .legal-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* ===== CONTACT FORM ===== */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
}

.contact-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    min-height: 150px;
    resize: vertical;
}

.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.success-message {
    padding: 1rem;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 5rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section p {
    color: #9ca3af;
    line-height: 1.8;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-lg);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 1rem 20px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        border-left-color: var(--primary-color);
        border-bottom-color: transparent;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content h2 {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

    .button-group {
        flex-direction: column;
    }

    .calculator-container,
    .legal-content {
        padding: 1.5rem;
    }

    .calculator-header h1 {
        font-size: 2rem;
    }
}

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

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .calculators-section,
    .features-section {
        padding: 3rem 0;
    }

    .calculator-card {
        padding: 1.5rem;
    }
}
