* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-description {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    text-align: center;
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.logo h1 {
    color: #667eea;
    font-size: 1.8rem;
    font-weight: 700;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-bar input {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: #667eea;
}

.search-bar button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-bar button:hover {
    background: #5a6fd8;
}

#clear-search-btn {
    background: #dc3545 !important;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

#clear-search-btn:hover {
    background: #c82333 !important;
}

/* Search functionality styles */
mark {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

#search-suggestions {
    border-top: none !important;
}

#search-suggestions div:hover,
#search-suggestions .active {
    background-color: #f0f0f0 !important;
}

#search-results {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    font-weight: 500;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.universal-calculator {
    text-align: center;
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.universal-calculator h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-weight: 600;
}

.calculator-container {
    max-width: 300px;
    margin: 0 auto;
}

.display {
    margin-bottom: 1rem;
}

.display input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: right;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f9f9f9;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.btn {
    padding: 1rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.operator {
    background: #667eea;
    color: white;
}

.operator:hover {
    background: #5a6fd8;
}

.function {
    background: #ff6b35;
    color: white;
}

.function:hover {
    background: #e55a2b;
}

.equal {
    background: #28a745;
    color: white;
    grid-column: span 2;
}

.equal:hover {
    background: #218838;
}

.clear {
    background: #dc3545;
    color: white;
}

.clear:hover {
    background: #c82333;
}

.categories {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.categories h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.category-card h3 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.category-card p {
    margin-bottom: 1.5rem;
    color: #666;
}

.category-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.category-btn:hover {
    background: #5a6fd8;
}

.all-calculators {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.all-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.all-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.description {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.description h2 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.description p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
}

footer {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.footer-copyright {
    color: #999;
    font-size: 0.9rem;
}

/* About, Terms, Privacy, Sitemap Pages */
.about-page, .terms-page, .privacy-page, .sitemap-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.about-page h1, .terms-page h1, .privacy-page h1, .sitemap-page h1 {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.about-content, .terms-content, .privacy-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-section, .terms-section, .privacy-section {
    margin-bottom: 2rem;
}

.about-section h2, .terms-section h2, .privacy-section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.about-section ul, .terms-section ul, .privacy-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.about-section li, .terms-section li, .privacy-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.about-section p, .terms-section p, .privacy-section p {
    line-height: 1.8;
    color: #555;
}

/* Sitemap Styles */
.sitemap-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sitemap-section {
    margin-bottom: 2rem;
}

.sitemap-section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.sitemap-section ul {
    list-style: none;
    padding: 0;
}

.sitemap-section li {
    margin-bottom: 0.5rem;
}

.sitemap-section a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.sitemap-section a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.sitemap-calculators {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.sitemap-calculators a {
    display: block;
    padding: 0.25rem 0;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.sitemap-calculators a:hover {
    color: #667eea;
}

/* Mortgage Calculator Styles */
.mortgage-calculator {
    text-align: center;
    margin-bottom: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.mortgage-calculator h2 {
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
}

.mortgage-calculator p {
    margin-bottom: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.calculator-container {
    max-width: 400px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.calculate-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
    width: 100%;
}

.calculate-btn:hover {
    background: #5a6fd8;
}

.results {
    margin-top: 2rem;
    text-align: left;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.results h3 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.result-label {
    font-weight: 500;
    color: #555;
}

.result-value {
    font-weight: 600;
    color: #667eea;
}

.calculators-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.calculators-page h1 {
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
}

.category-nav {
    margin-bottom: 2rem;
    text-align: center;
}

.category-nav a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
}

.category-nav a:hover,
.category-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.calculators-page p {
    margin-bottom: 2rem;
    color: white;
    font-size: 1.1rem;
}

.calculators-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.calculator-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.calculator-section h2 {
    margin-bottom: 1rem;
    color: #333;
    font-weight: 600;
    font-size: 1.2rem;
}

.calculator-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
}

.calculator-item {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-align: center;
}

.calculator-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background: #e9ecef;
}

.calculator-item h3 {
    margin: 0;
    color: #333;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.calc-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
}

.calc-btn:hover {
    background: #5a6fd8;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar input {
        flex: 1;
    }

    main {
        padding: 1rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .buttons {
        grid-template-columns: repeat(5, 1fr);
    }

    .equal {
        grid-column: span 5;
    }

    .calculators-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modern Contact Section */
    .contact-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        margin: 4rem auto;
        max-width: 1200px;
        padding: 0 2rem;
        align-items: start;
    }
    
    .contact-info-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 4rem 3rem;
        border-radius: 25px;
        text-align: center;
        box-shadow: 0 25px 50px rgba(102, 126, 234, 0.3);
        position: relative;
        overflow: hidden;
    }
    
    .contact-info-card::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        animation: float 6s ease-in-out infinite;
    }
    
    .contact-icon {
        margin-bottom: 1.5rem;
        display: inline-block;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        backdrop-filter: blur(10px);
    }
    
    .contact-info-card h3 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
        font-weight: 600;
    }
    
    .contact-info-card p {
        margin-bottom: 2rem;
        opacity: 0.9;
        line-height: 1.6;
    }
    
    .contact-email {
        background: rgba(255, 255, 255, 0.15);
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 2rem;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .contact-features {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .feature {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        backdrop-filter: blur(5px);
    }
    
    .feature-icon {
        font-size: 1.2rem;
    }
    
    .contact-form-card {
        background: white;
        padding: 4rem;
        border-radius: 25px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.8);
    }
    
    .form-header {
        text-align: center;
        margin-bottom: 2.5rem;
    }
    
    .form-header h3 {
        color: #333;
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
    
    .form-header p {
        color: #666;
        font-size: 1rem;
    }
    
    .form-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .input-wrapper {
        position: relative;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .input-icon {
        flex-shrink: 0;
        margin-top: 0.75rem;
        opacity: 0.7;
        transition: opacity 0.3s ease;
    }
    
    .textarea-icon {
        margin-top: 0.5rem;
    }
    
    .input-wrapper:focus-within .input-icon {
        opacity: 1;
        color: #667eea;
    }
    
    .form-group input,
    .form-group textarea {
        flex: 1;
        padding: 1.25rem 1.5rem;
        border: 2px solid #e0e0e0;
        border-radius: 20px;
        font-size: 1.1rem;
        font-family: inherit;
        transition: all 0.3s ease;
        background: #ffffff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
        min-height: 60px;
    }
    
    .form-group input:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        transform: translateY(-2px);
    }
    
    .form-group textarea {
        resize: vertical;
        min-height: 120px;
        line-height: 1.6;
        align-items: flex-start;
    }
    
    .contact-submit-btn {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-radius: 50px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 600;
        width: 100%;
        text-transform: uppercase;
        letter-spacing: 1px;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        position: relative;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn-text {
        flex: 1;
    }
    
    .btn-icon {
        transition: transform 0.3s ease;
    }
    
    .contact-submit-btn:hover {
        background: linear-gradient(135deg, #5a6fd8 0%, #6a4198 100%);
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    .contact-submit-btn:hover .btn-icon {
        transform: rotate(15deg);
    }
    
    .contact-submit-btn:active {
        transform: translateY(-1px);
    }
    
    /* Animations */
    @keyframes float {
        0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
        50% { transform: translate(-50%, -50%) rotate(5deg); }
    }
    
    /* Responsive design */
    @media (max-width: 1024px) {
        .contact-section {
            grid-template-columns: 1fr;
            gap: 3rem;
            margin: 3rem auto;
            padding: 0 1rem;
        }
    
        .contact-info-card,
        .contact-form-card {
            padding: 3rem 2rem;
        }
    }
    
    @media (max-width: 768px) {
        .contact-section {
            margin: 2rem auto;
            padding: 0 1rem;
            gap: 2rem;
        }
    
        .form-row {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
    
        .contact-info-card,
        .contact-form-card {
            padding: 2.5rem 1.5rem;
            border-radius: 20px;
        }
    
        .contact-info-card h3,
        .form-header h3 {
            font-size: 1.5rem;
        }
    
        .contact-submit-btn {
            padding: 1rem 2rem;
            font-size: 1rem;
        }
    
        .form-group input,
        .form-group textarea {
            padding: 1rem 1.25rem;
            font-size: 1rem;
            min-height: 50px;
        }
    
        .input-wrapper {
            gap: 0.5rem;
        }
    
        .input-icon {
            width: 18px;
            height: 18px;
        }
    }
}