/* ========== MODERN UI ENHANCEMENTS ========== */
:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary-light: #e9f0ff;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --dark: #1e2a3e;
    --light-gray: #f8f9fc;
    --card-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #f4f7fc 0%, #eef2f6 100%);
    color: #1a2a3a;
    scroll-behavior: smooth;
}

/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ========== NAVBAR ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.7rem;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    letter-spacing: -0.3px;
}
.navbar-brand i {
    background: none;
    color: #0d6efd;
    margin-right: 6px;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: 50px;
    padding: 0.5rem 1rem !important;
}
.nav-link:hover {
    background: #f0f2f5;
    transform: translateY(-2px);
}

/* ========== HERO SECTION (Homepage) ========== */
.hero-section {
    background: linear-gradient(145deg, #0d6efd 0%, #0b5ed7 100%);
    border-radius: 2rem;
    padding: 3rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    transform: rotate(25deg);
    pointer-events: none;
}
.hero-section h1 {
    font-weight: 800;
    font-size: 2.8rem;
    letter-spacing: -0.02em;
}
.search-box input {
    border-radius: 60px;
    padding: 0.75rem 1.5rem;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    font-size: 1rem;
}

/* ========== TOOL CARDS (Modern Glass) ========== */
.tool-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 1.5rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--card-shadow);
}
.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    background: white;
    border-color: rgba(13,110,253,0.2);
}
.tool-card i {
    font-size: 2.8rem;
    background: linear-gradient(145deg, #0d6efd, #0a58ca);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
}
.tool-card h5 {
    font-weight: 700;
    margin-top: 0.5rem;
}

/* ========== CALCULATOR FORM ========== */
.calculator-form {
    background: white;
    border-radius: 1.75rem;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}
.calculator-form label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}
.form-control, .form-select {
    border-radius: 1rem;
    padding: 0.7rem 1rem;
    border: 1.5px solid #e2e8f0;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.2);
}
.btn-primary {
    background: linear-gradient(145deg, #0d6efd, #0a58ca);
    border: none;
    border-radius: 2rem;
    padding: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(13,110,253,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13,110,253,0.4);
    background: linear-gradient(145deg, #0b5ed7, #0950b3);
}

/* ========== RESULT CARD ========== */
.result-card {
    background: linear-gradient(125deg, #eef5ff 0%, #e0ecfe 100%);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border-left: 7px solid var(--primary);
    margin-top: 1.5rem;
    box-shadow: var(--card-shadow);
}
.result-card h5 {
    font-weight: 700;
}
#resultValue p {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    background: white;
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    display: inline-block;
    width: auto;
}
.btn-copy, .btn-print {
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

/* ========== SIDEBAR & ADS ========== */
.sidebar-ad {
    position: sticky;
    top: 100px;
}
.ad-container {
    background: rgba(0,0,0,0.02);
    border-radius: 1.25rem;
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    border: 1px dashed #cbd5e1;
    transition: var(--transition);
}
.card-header {
    font-weight: 700;
    background: var(--primary) !important;
    border-radius: 1rem 1rem 0 0 !important;
}

/* ========== FAQ SECTION ========== */
.faq-section .mb-3 {
    background: white;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.faq-section strong {
    color: var(--primary-dark);
}

/* ========== FOOTER MODERN ========== */
.footer {
    background: #0f172a;
    color: #cbd5e1;
    border-top: 1px solid #1e293b;
}
.footer h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}
.footer a {
    transition: var(--transition);
}
.footer a:hover {
    color: white;
    padding-left: 5px;
}

/* ========== RESPONSIVE FINE-TUNING ========== */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .calculator-form {
        padding: 1.25rem;
    }
    .tool-card {
        padding: 1rem 0.5rem;
    }
    .result-card {
        padding: 1rem;
    }
    #resultValue p {
        font-size: 0.9rem;
        display: block;
        margin-bottom: 0.75rem;
    }
}
@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    .btn-primary {
        font-size: 0.9rem;
    }
}

/* ========== PRINT STYLES ========== */
@media print {
    .ad-container, .sidebar-ad, .btn-copy, .btn-print, nav, footer, .related-links {
        display: none !important;
    }
    .result-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.calculator-form, .result-card, .tool-card {
    animation: fadeInUp 0.4s ease-out;
}


.pwa-install-box {
    position: fixed;
    left: 15px;
    right: 15px;
    bottom: 20px;
    z-index: 9999;
}

.pwa-card {
    max-width: 520px;
    margin: auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    position: relative;
}

.pwa-close {
    position: absolute;
    top: 10px;
    right: 15px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
}

.pwa-feature {
    background: #f4f8ff;
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    height: 100%;
}

.pwa-feature i {
    display: block;
    font-size: 22px;
    color: #0d6efd;
    margin-bottom: 8px;
}

.pwa-feature span {
    font-size: 12px;
    font-weight: 600;
}