:root {
    --primary-color: #00A8E8;
    /* Light Blue */
    --secondary-color: #007EA7;
    /* Darker Blue for hover */
    --background-color: #FFFFFF;
    --surface-color: #F8F9FA;
    /* Light Grey for cards */
    --text-color: #333333;
    --text-light: #666666;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --header-height: 70px;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* Button Upgrade */
.btn {
    display: inline-block;
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 168, 232, 0.3);
    text-align: center;
    min-width: 150px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 168, 232, 0.4);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 168, 232, 0.2);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -0.5px;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

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

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-menu a {
    font-weight: 600;
    color: #4a5568;
    transition: color 0.2s;
    font-size: 1.05rem;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #E0F7FA 0%, #FFFFFF 100%);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #E1E1E1;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
}

/* Categories Section */
.categories {
    padding: 80px 0;
}

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

.tool-card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.tool-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Popular Tools Section (also used for general tools lists) */
.tools-section {
    padding: 60px 0;
    background-color: var(--surface-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.mini-tool-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: all 0.2s;
}

.mini-tool-card:hover {
    box-shadow: var(--shadow);
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: #f1f1f1;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    margin-right: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Tool Page Structure - Professional Card */
.tool-page-container {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.calculator-wrapper {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Mobile Responsive Adjustments */
@media (max-width: 600px) {
    .calculator-wrapper {
        padding: 25px;
    }
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.05rem;
    text-align: left;
    /* Explicitly align labels */
}

/* Modern Input Fields */
.form-group input,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    color: #2d3748;
    appearance: none;
    /* Remove default styling */
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 168, 232, 0.15);
}

/* Result Box - Premium Look */
.result-box {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    display: none;
    text-align: center;
    border: 2px solid rgba(0, 168, 232, 0.2);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box.active {
    display: block;
}

/* Result Typography */
#result,
#bmi-result,
#grade-result,
#age-result,
.result-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
    line-height: 1.4;
}

.result-box p {
    color: #4a5568;
    font-size: 1.1rem;
}

.seo-content {
    color: #718096;
    font-size: 0.95rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .nav-menu {
        display: none;
    }

    .tool-card {
        padding: 20px;
    }

    /* Footer Mobile Fix */
    footer {
        text-align: center;
        padding: 40px 0 30px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .footer-brand {
        margin-bottom: 10px;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .footer-links a {
        margin-right: 0;
        font-size: 1rem;
    }
}

/* Professional Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #999;
    pointer-events: none;
    transition: color 0.3s;
}

.search-box input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    /* Left padding for icon */
    border: 2px solid #E1E1E1;
    border-radius: 50px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 168, 232, 0.15);
}

.search-box input:focus+.search-icon,
.search-wrapper:focus-within .search-icon {
    color: var(--primary-color);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #eee;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    /* Hidden by default */
    text-align: left;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.search-results.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f8f9fa;
}

.search-result-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.search-result-icon {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 168, 232, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.search-result-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.search-result-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
}

/* Custom Scrollbar for results */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}


/* SEARCH FIX & ENHANCEMENT */
/* Re-adding search box styles that might have been overwritten or need boost */
.search-box {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.search-box input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    /* Better padding */
    border: 2px solid transparent;
    background-color: white;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 1.1rem;
    outline: none;
    transition: var(--transition);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    /* Deep float shadow */
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 4px rgba(79, 70, 229, 0.2);
    /* Ring effect */
}

.search-wrapper .search-icon {
    left: 24px;
    width: 24px;
    height: 24px;
    color: var(--text-light);
}


/* FAQ Section */
.faq-section {
    background-color: var(--surface-color);
}

.faq-item {
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.faq-question {
    padding: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    transition: background-color 0.2s;
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    line-height: 1;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--surface-hover);
}

.faq-answer p {
    padding: 24px;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
}

/* Active State */
.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    /* Safe height for wrapped text on mobile */
}


/* MOBILE MENU STYLES */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: linear-gradient(135deg, #00A8E8 0%, #007EA7 100%);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1000;
        display: flex;
        transform: translateX(100%);
        visibility: hidden;
    }

    .nav-menu.show {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }

    .nav-menu a {
        font-size: 1.5rem;
        font-weight: 700;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 10px 20px;
        border-radius: 30px;
        transition: all 0.3s ease;
    }

    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
        color: white;
    }

    /* Animate Hamburger to X */
    .mobile-menu-toggle.active span {
        background-color: white;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Common Control Groups (Buttons etc) */
.controls {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.controls .btn {
    margin: 5px 0;
    /* Vertical margin for wrap cases */
}

@media (max-width: 600px) {
    .btn {
        min-width: 0 !important;
        width: 100%;
    }

    .controls .btn {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* Responsive Row Utilities */
.grade-row,
.gpa-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {

    .grade-row,
    .gpa-row {
        flex-direction: column;
        align-items: stretch;
        background: #f8fafc;
        padding: 15px;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
    }

    .grade-row input,
    .gpa-row input,
    .gpa-row select {
        width: 100% !important;
        flex: none !important;
    }

    .timer-display {
        font-size: 4rem !important;
    }

    .counter-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Related Tools Section */
.related-tools {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.related-tools h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-color);
    text-align: left;
}

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

.related-card {
    background: #f8fbff;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid #e0e7ff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-card:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.related-card h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

.related-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

.related-card-link {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 5px;
}

/* SEO Description Styles */
/* SEO Description Styles - Premium Upgrade */
.tool-instructions {
    margin-top: 50px;
    background: #fdfdfd;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e7ff;
    position: relative;
    overflow: hidden;
}

.tool-instructions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.tool-instructions h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2d3748;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-instructions h2::before {
    content: '💡';
    font-size: 1.2rem;
}


/* AD PLACEMENT STYLES */
.ad-slot {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    margin: 40px auto;
    padding: 30px;
    text-align: center;
    min-height: 120px;
    max-width: 970px;
    /* Standard large leaderboard width */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-slot:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.ad-slot::before {
    content: "ADVERTISEMENT";
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.ad-slot-top {
    margin-top: 20px;
    margin-bottom: 40px;
}

.ad-slot-bottom {
    margin-top: 50px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .ad-slot {
        min-height: 90px;
        padding: 20px;
        margin: 25px auto;
        border-radius: 8px;
    }

    .ad-slot-top {
        margin-top: 10px;
        margin-bottom: 25px;
    }

    .ad-slot-bottom {
        margin-top: 30px;
    }
}