body {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    height: 100%;
}

/* Header styles */
.header {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.15);
}

/* Desktop nav links */
.nav-link {
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
}

.nav-link:hover {
    color: #e5e7eb;
    transform: scale(1.05);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
    animation: fadeInDown 0.25s ease;
    z-index: 1200;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #4a5568;
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding-left: 28px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
}

/* Mobile slide-down menu */
.mobile-menu {
    display: none;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    padding: 10px 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.mobile-menu.open {
    display: block;
    max-height: 420px;
    opacity: 1;
}

.mobile-menu a {
    display: block;
    color: #ecfdf5;
    padding: 8px 0;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    color: #bbf7d0;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.05)"/></svg>') repeat-x bottom;
    background-size: 1200px 120px;
    opacity: 0.3;
}

.page-header h1 {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: slideInDown 0.6s ease;
}

.page-header p {
    font-size: 22px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: slideInUp 0.6s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Calculator Container */
.calculator-container {
    max-width: 1200px;
    margin: -60px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.calculator-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: slideUp 0.6s ease;
}

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

.intro-text {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 32px;
    text-align: justify;
}

/* Mode Selection */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.mode-tab {
    padding: 16px 24px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
    color: #4a5568;
    font-size: 15px;
}

.mode-tab:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: #f093fb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.mode-tab.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: #f093fb;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #f093fb;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.1);
    transform: translateY(-2px);
}

.input-hint {
    font-size: 13px;
    color: #718096;
    margin-top: 6px;
    font-style: italic;
}

.calculate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.5);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Result Display */
.result-container {
    margin-top: 32px;
    display: none;
    animation: resultSlide 0.5s ease;
}

.result-container.show {
    display: block;
}

@keyframes resultSlide {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 40px;
    border-radius: 16px;
    color: white;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.result-label {
    font-size: 16px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    font-weight: 600;
}

.result-value {
    font-size: 56px;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: pulse 2s ease-in-out infinite;
    margin-bottom: 12px;
    word-break: break-all;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.result-details {
    background: #f7fafc;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-content {
    color: #4a5568;
    line-height: 1.8;
    font-size: 15px;
}

.formula-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    margin: 16px 0;
    overflow-x: auto;
    font-size: 15px;
}

.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 24px;
    background: white;
    color: #f093fb;
    border: 2px solid #f093fb;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.download-btn:hover {
    background: #f093fb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.step-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #f093fb;
}

.step-item:last-child {
    margin-bottom: 0;
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.info-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #f093fb;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(240, 147, 251, 0.2);
}

.info-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.info-card p {
    color: #4a5568;
    line-height: 1.7;
    font-size: 15px;
}

/* Blog Section */
.blog-section {
    max-width: 900px;
    margin: 80px auto;
    padding: 0 20px;
}

.blog-content {
    background: white;
    border-radius: 24px;
    padding: 60px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    line-height: 1.8;
}

.blog-content h2 {
    font-size: 42px;
    font-weight: 900;
    color: #1a202c;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-top: 40px;
    margin-bottom: 20px;
}

.blog-content h4 {
    font-size: 22px;
    font-weight: 600;
    color: #4a5568;
    margin-top: 32px;
    margin-bottom: 16px;
}

.blog-content p {
    color: #4a5568;
    font-size: 17px;
    margin-bottom: 24px;
    line-height: 1.9;
}

.blog-content ul,
.blog-content ol {
    color: #4a5568;
    margin-left: 32px;
    margin-bottom: 24px;
}

.blog-content li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.blog-content strong {
    color: #f093fb;
    font-weight: 700;
}

.blog-content em {
    font-style: italic;
    color: #f5576c;
}

.highlight-box {
    background: linear-gradient(135deg, #fef3f8 0%, #fff0f5 100%);
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid #f093fb;
    margin: 32px 0;
}

/* FAQ Section */
.faq-section {
    margin-top: 24px;
}

.faq-item {
    padding: 18px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.faq-item h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.faq-item p {
    margin-bottom: 0;
}

/* Code/Formula block */
.formula-box {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    margin: 24px 0;
    overflow-x: auto;
    font-size: 15px;
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-column h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-column ul li a:hover {
    color: #f093fb;
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    padding-top: 30px;
    text-align: center;
    color: #a0aec0;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide all desktop nav on mobile (Home / Calculators / Blog / More) */
    .main-nav-center,
    .header .nav-links {
        display: none !important;
    }

    /* Show only the hamburger */
    .mobile-menu-btn {
        display: block;
    }

    .page-header h1 {
        font-size: 36px;
    }

    .page-header p {
        font-size: 18px;
    }

    .calculator-card {
        padding: 24px;
    }

    .result-value {
        font-size: 40px;
    }

    .blog-content {
        padding: 32px 24px;
    }

    .blog-content h2 {
        font-size: 32px;
    }

    .blog-content h3 {
        font-size: 24px;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
    }

    .mode-tabs {
        grid-template-columns: 1fr;
    }
}
