/* Reset & Core Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-color: #060a17;
    --card-bg: #0d1428;
    --text-main: #e6ebf5;
    --text-muted: #93a1bf;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --border: #1c2a4a;
    --shadow: 0 4px 20px rgb(59 130 246 / 0.15);
    --body-gradient:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.25), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.18), transparent 40%),
        linear-gradient(180deg, #000000 0%, #05070f 30%, #060a17 60%, #0a1128 100%);
    --header-bg: rgba(6, 10, 23, 0.85);
    --fav-btn-bg: rgba(6, 10, 23, 0.6);
    --accent-bg: rgba(59, 130, 246, 0.08);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #5b6b85;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #cfe3fb;
    --shadow: 0 4px 20px rgb(37 99 235 / 0.10);
    --body-gradient:
        radial-gradient(circle at 15% 0%, rgba(191, 219, 254, 0.5), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(219, 234, 254, 0.6), transparent 40%),
        linear-gradient(180deg, #ffffff 0%, #f5f9ff 50%, #eaf3ff 100%);
    --header-bg: rgba(255, 255, 255, 0.88);
    --fav-btn-bg: rgba(219, 234, 254, 0.8);
    --accent-bg: #eaf3ff;
}

body {
    background-color: var(--bg-color);
    background-image: var(--body-gradient);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Navigation Bar */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

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

.logo-img {
    height: 32px;
    width: 32px;
    object-fit: contain;
    display: block;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

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

/* Main Layout Grid */
main {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

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

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
}

/* Tool Grid Cards */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background-color: var(--card-bg);
    background-image: linear-gradient(160deg, rgba(59, 130, 246, 0.08), transparent 60%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.tool-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 0.5rem;
}

.tool-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.tool-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Footer Section */
footer {
    background-color: rgba(13, 20, 40, 0.6);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.75rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}


















/* ==========================================================================
   PREMIUM UX ANIMATIONS & TOOL PAGE UPGRADES
   ========================================================================== */

/* Keyframe Entry Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseBorder {
    0% { border-color: var(--border); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1); }
    50% { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
    100% { border-color: var(--border); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1); }
}

@keyframes floatElement {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

/* Apply Entry Animation to Core Tool Containers */
.tool-container {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.tool-container:hover {
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
}

/* Smooth Input Focus State Transitions */
.input-group input, 
.input-group select, 
textarea {
    transition: all 0.25s ease-in-out !important;
}

.input-group input:focus, 
.input-group select:focus, 
textarea:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15) !important;
}

/* Interactive Button Hover Animations */
.btn-generate, .btn-calculate, .btn-convert, .btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-generate:hover, .btn-calculate:hover, .btn-convert:hover, .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    filter: brightness(1.05);
}

.btn-generate:active, .btn-calculate:active, .btn-convert:active, .btn-primary:active {
    transform: translateY(1px);
}

/* High-Value Documentation Section Layout */
.tool-documentation {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.doc-feature-card {
    background: var(--bg-color);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

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

.doc-grid-item h5 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
/* ===== Theme Toggle Button ===== */
.nav-container {
    justify-content: flex-start;
}

nav#siteNav {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    row-gap: 0.5rem;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 1rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* ===== Mobile Nav / Hamburger Menu ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-muted);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: 1rem 1.25rem;
    }

    .theme-toggle-btn {
        order: 1;
        margin-left: auto;
        width: 36px;
        height: 36px;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        margin-left: 0.75rem;
    }

    nav#siteNav {
        order: 3;
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        transition: max-height 0.3s ease;
    }

    nav#siteNav.open {
        max-height: 500px;
        margin-top: 1rem;
    }

    nav#siteNav a {
        margin-left: 0;
        padding: 0.75rem 0;
        border-top: 1px solid var(--border);
    }
}

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */
.search-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 2.5rem;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.search-icon {
    font-size: 1.1rem;
    padding: 0 0.6rem;
    pointer-events: none;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    padding: 0.85rem 0.25rem;
    -webkit-appearance: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    margin-right: 0.25rem;
}

.clear-search.show {
    display: flex;
}

.clear-search:hover {
    background: var(--primary);
    color: #fff;
}

/* ==========================================================================
   SEARCH RESULTS
   ========================================================================== */
.search-results {
    display: none;
    margin-bottom: 3rem;
}

.no-results {
    display: none;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* ==========================================================================
   SECTION BLOCKS
   ========================================================================== */
.section-block {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.popular-grid .tool-card {
    border-color: rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   INFO CARDS (Quiz / Interview / Learning Resources sections)
   ========================================================================== */
.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background-color: var(--card-bg);
    background-image: linear-gradient(160deg, rgba(59, 130, 246, 0.08), transparent 60%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.info-card-btn {
    align-self: flex-start;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.info-card-btn:hover {
    background-color: var(--primary-hover);
}

/* ==========================================================================
   CATEGORY TABS
   ========================================================================== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

.cat-tab {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cat-tab:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.cat-tab.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.category-panel {
    display: none;
}

.category-panel.active {
    display: grid;
}

.coming-soon {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

@media (max-width: 768px) {
    .category-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.4rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-tabs::-webkit-scrollbar {
        display: none;
    }

    .search-box input {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}

/* ==========================================================================
   FAVORITE STAR BUTTON
   ========================================================================== */
.tool-card {
    position: relative;
}

.fav-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--fav-btn-bg);
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.fav-btn:hover {
    border-color: #fbbf24;
    color: #fbbf24;
    transform: scale(1.1);
}

.fav-btn.is-fav {
    color: #fbbf24;
    border-color: #fbbf24;
}

.tool-card h3 {
    padding-right: 2rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
}

/* ==========================================================================
   UNIVERSAL OUTPUT TOOLBAR (Copy / Download / Clear / Share)
   ========================================================================== */
.cma-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.cma-btn {
    flex: 1 1 auto;
    min-width: 100px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.cma-btn:hover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.cma-btn:active {
    transform: translateY(1px);
}

.cma-btn[data-action="clear"]:hover {
    border-color: #ef4444;
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.1);
}

@media (max-width: 480px) {
    .cma-btn {
        min-width: 44%;
    }
}

/* ==========================================================================
   TRUST BADGES
   ========================================================================== */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1.75rem 1rem;
    border-top: 1px solid var(--border);
}

.trust-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s;
}

.trust-item:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

@media (max-width: 480px) {
    .trust-badges {
        gap: 0.6rem;
    }

    .trust-item {
        font-size: 0.78rem;
        padding: 0.45rem 0.8rem;
    }
}

/* ==========================================================================
   COURSES — Hub, Chapter Index & Reading Pages
   ========================================================================== */
.course-main .content {
    max-width: 820px;
    margin: 0 auto;
    background-color: var(--card-bg);
    background-image: linear-gradient(160deg, rgba(59, 130, 246, 0.06), transparent 60%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.course-main .content h1 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.course-main .content > p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.course-main .content h2 {
    font-size: 1.35rem;
    margin: 2rem 0 0.9rem;
    color: var(--primary-hover);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.course-main .content p {
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.course-main .content ul,
.course-main .content ol {
    color: var(--text-muted);
    line-height: 1.8;
    margin: 0 0 1.25rem 1.5rem;
}

.course-main .content li {
    margin-bottom: 0.4rem;
}

.course-main .content strong {
    color: var(--text-main);
}

.course-main .content code {
    background-color: rgba(59, 130, 246, 0.12);
    color: var(--primary-hover);
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.course-main .content pre {
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
}

.course-main .content pre code {
    background: none;
    color: var(--text-main);
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Course Hub Modules List */
.course-menu {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.course-menu h2 {
    margin-top: 0 !important;
    border-bottom: none !important;
}

.course-menu ul {
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.course-menu li {
    margin-bottom: 0 !important;
}

.course-menu li a {
    display: block;
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: border-color 0.2s, transform 0.2s, color 0.2s;
}

.course-menu li a:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    transform: translateX(4px);
}

/* Chapter Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pagination a {
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: 600;
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    transition: border-color 0.2s, background-color 0.2s;
}

.pagination a:hover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

.pagination a:only-child {
    margin-left: auto;
}

@media (max-width: 640px) {
    .course-main .content {
        padding: 1.5rem;
    }

    .course-main .content h1 {
        font-size: 1.5rem;
    }

    .pagination {
        flex-direction: column;
    }

    .pagination a:only-child {
        margin-left: 0;
    }
}


