/* ========================================
   MODERN UI REDESIGN
   Contemporary, Clean & Professional
   ======================================== */

:root {
    --primary-blue: #80b3ff;
    --primary-dark: #0067ff;
    --light-bg: #f5f7fb;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-light: #e8eef5;
    --shadow-sm: 0 2px 8px rgba(0, 102, 255, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 102, 255, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 102, 255, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
    font-family: 'Futura', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all text has proper contrast */
* {
    color-scheme: light dark;
}

p, span, li, label, div, section, article {
    color: var(--text-primary);
}

strong, b, .bold {
    color: var(--text-primary);
    font-weight: 700;
}

small, .small {
    color: var(--text-secondary);
}

/* ========================================
   PAGE UTILITIES
   ======================================== */

.page-bg {
    position: relative;
}

.page-bg::before {
    content: '';
    position: fixed;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background-image: url('../images/maitech half logo black 14000x15000.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .page-bg::before {
        background-image: url('../images/maitech half logo white 14000x15000.png');
    }
}

@media (max-width: 768px) {
    .page-bg::before {
        width: 100%;
        height: 60vh;
        background-position: right top;
        background-size: contain;
    }
}

/* Flash messages */
.flash {
    padding: 12px 18px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 600;
    opacity: 1;
    transition: opacity 1s ease-out;
    position: relative;
    z-index: 1050;
}

.flash.success {
    background: #d4ffd4;
    color: #0a750a;
    border-left: 5px solid #0a750a;
}

.flash.error {
    background: #ffd4d4;
    color: #8a0000;
    border-left: 5px solid #8a0000;
}

#flashBox {
    display: none;
}

#flashBox.show {
    display: block;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.3;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.4;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ========================================
   NAVBAR - MODERN DESIGN
   ======================================== */

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    z-index: 1050;
    overflow: visible;
}

.navbar > .container {
    overflow: visible;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
}

.navbar-collapse {
    z-index: 1049;
    position: relative;
}

.navbar-collapse.show {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1049;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-toggler {
    z-index: 1051;
    position: relative;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand img {
    height: 40px;
    margin-right: 0.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-dark));
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-blue) !important;
}

.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    color: var(--primary-blue);
    transition: var(--transition);
}

.navbar-icon:hover {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   HERO SECTION - MODERN DESIGN
   ======================================== */

.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    animation: slideInUp 0.8s ease-out;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

/* Transparent variant for light pages */
.hero-plain {
    background: transparent !important;
}

.hero-plain .hero-heading,
.hero-plain .hero-subtext {
    color: #0e1a2b !important;
}

@media (prefers-color-scheme: dark) {
    .hero-plain .hero-heading,
    .hero-plain .hero-subtext {
        color: #f5f5f5 !important;
    }
}

.hero-section .input-group {
    background: white;
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 8px;
    max-width: 500px;
}

.hero-section input[type="search"] {
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    flex: 1;
    color: var(--text-primary);
}

.hero-section input[type="search"]::placeholder {
    color: var(--text-light);
}

.hero-section input[type="search"]::-webkit-input-placeholder {
    color: var(--text-light);
}

.hero-section input[type="search"]:-ms-input-placeholder {
    color: var(--text-light);
}

.hero-section input[type="search"]::-moz-placeholder {
    color: var(--text-light);
}

.hero-section button[type="submit"] {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.hero-section button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

/* ========================================
   CARDS - MODERN DESIGN
   ======================================== */

.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.card-header {
    background: linear-gradient(135deg, var(--light-bg), white);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   BUTTONS - MODERN DESIGN
   ======================================== */

.btn {
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.25);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

/* ========================================
   FEATURED SECTION
   ======================================== */

.featured-section {
    background: white;
    padding: 80px 0;
    position: relative;
}

.featured-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-dark));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

.feature-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   CUSTOM BLOCKS
   ======================================== */

.custom-block {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.custom-block:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue);
}

.custom-block-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.custom-block-content {
    padding: 1.5rem;
}

.custom-block-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.custom-block-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.custom-block-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.custom-block-category {
    display: inline-block;
    background: var(--light-bg);
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========================================
   SECTION STYLING
   ======================================== */

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-dark));
    border-radius: 2px;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* ========================================
   TIMELINE - MODERN DESIGN
   ======================================== */

.timeline-section {
    background: linear-gradient(135deg, var(--light-bg), white);
    padding: 80px 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: center;
}

.timeline-item:nth-child(even) {
    direction: rtl;
}

.timeline-item:nth-child(even) > * {
    direction: ltr;
}

.timeline-dot {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 0 12px var(--light-bg), 0 0 0 14px var(--border-light);
}

.timeline-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--primary-blue);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.timeline-content h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.timeline-content p {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   FORMS - MODERN DESIGN
   ======================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control,
.form-select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
    color: var(--text-primary);
    font-family: inherit;
}

.form-control::placeholder,
textarea::placeholder {
    color: var(--text-light);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form alerts and messages */
.alert, .flash, .message {
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success, .flash.success, .message.success {
    background-color: #d4ffd4;
    color: #0a750a;
    border-left-color: #0a750a;
}

.alert-error, .flash.error, .message.error {
    background-color: #ffd4d4;
    color: #8a0000;
    border-left-color: #8a0000;
}

.alert-info, .flash.info, .message.info {
    background-color: #d4e8ff;
    color: #004da6;
    border-left-color: #0066ff;
}

.alert-warning, .flash.warning, .message.warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ff9800;
}

/* ========================================
   FOOTER - MODERN DESIGN
   ======================================== */

.site-footer {
    background: transparent;
    color: #666666;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h6 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-link {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: block;
    margin-bottom: 0.75rem;
}

.footer-link:hover {
    color: white;
    padding-left: 4px;
}

.footer-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
}

.footer-bottom {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary {
    color: var(--primary-blue) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-light {
    color: var(--text-light) !important;
}

.bg-light {
    background: var(--light-bg) !important;
    color: var(--text-primary) !important;
}

.border-light {
    border-color: var(--border-light) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* Ensure all text has proper contrast */
p, span, a, li, label, .text-content, .paragraph {
    color: var(--text-primary);
}

/* Ensure form elements have visible text */
input, textarea, select {
    color: var(--text-primary);
}

/* Ensure buttons have visible text */
.btn, button {
    color: inherit;
}

/* Ensure headings are visible */
h1, h2, h3, h4, h5, h6, .heading {
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }

    .hero-section {
        padding: 80px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        direction: ltr;
    }

    .timeline-dot {
        margin-bottom: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }

    .navbar-collapse.show {
        position: static;
        background: transparent;
        box-shadow: none;
        border-top: 1px solid var(--border-light);
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }

    .navbar-toggler:focus {
        box-shadow: none;
        outline: 2px solid var(--primary-blue);
        outline-offset: 2px;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link.active {
        color: var(--primary-blue) !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero-section {
        padding: 60px 0;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .btn {
        width: 100%;
    }

    .hero-section .input-group {
        flex-direction: column;
    }

    .hero-section input[type="search"] {
        width: 100%;
    }

    .hero-section button[type="submit"] {
        width: 100%;
    }
}

/* ========================================
   BOOTSTRAP UTILITY OVERRIDES
   ======================================== */

/* Dropdown menu items - ensure readability */
.dropdown-menu {
    background: white;
    border: 1px solid var(--border-light);
}

.dropdown-item {
    color: var(--text-primary);
    background: transparent;
    transition: var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--light-bg);
    color: var(--primary-blue);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-blue);
    color: white;
}

/* Ensure all text is readable */
.text-muted {
    color: var(--text-secondary) !important;
}

.text-white {
    color: white !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

/* Ensure disabled form elements are readable */
.form-control:disabled,
.form-control[readonly] {
    background-color: var(--light-bg);
    color: var(--text-light);
    opacity: 1;
}

/* ========================================
   WHITE/BLACK THEME - TOPICS LISTING PAGE
   ======================================== */

/* Background logo container */
.topics-listing-page .fixed-logo-bg {
    position: fixed;
    right: 0;
    top: 0;
    width: 50%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

/* Main content overlay z-index */
.topics-listing-page main {
    position: relative;
    z-index: 1;
}

/* White background theme */
.topics-listing-page {
    background: white;
    color: #000;
}

/* Navigation styling */
.topics-listing-page .navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e0e0e0;
}

.topics-listing-page .navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.topics-listing-page .navbar-nav .nav-link:hover {
    color: var(--primary-blue) !important;
}

/* Header styling */
.topics-listing-page .site-header {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid #e0e0e0;
}

.topics-listing-page .site-header h2 {
    color: #000;
    font-size: 2.5rem;
    font-weight: 700;
}

.topics-listing-page .breadcrumb {
    background: transparent;
}

.topics-listing-page .breadcrumb-item a {
    color: var(--primary-blue);
}

.topics-listing-page .breadcrumb-item.active {
    color: #000;
}

/* Section backgrounds */
.topics-listing-page .section-padding {
    background: white;
}

.topics-listing-page section h2,
.topics-listing-page section h3,
.topics-listing-page section h4 {
    color: #000;
}

.topics-listing-page .section-padding:nth-of-type(odd) {
    background: white;
}

.topics-listing-page .section-padding:nth-of-type(even) {
    background: #f8f9fa;
}

/* Feature card styling */
.topics-listing-page .custom-block-topics-listing {
    background: white;
    border-left: 4px solid var(--primary-blue);
    padding: 2rem;
    transition: all 0.3s ease;
}

.topics-listing-page .custom-block-topics-listing:hover {
    box-shadow: 0 10px 30px rgba(0, 102, 255, 0.2);
    transform: translateY(-5px);
}

.topics-listing-page .custom-block-topics-listing h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 700;
}

.topics-listing-page .custom-block-topics-listing p {
    color: #333;
    line-height: 1.8;
}

/* Text colors */
.topics-listing-page .text-secondary {
    color: #666 !important;
}

.topics-listing-page p {
    color: #333;
}

/* Button styling */
.topics-listing-page .btn-custom,
.topics-listing-page .custom-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.topics-listing-page .btn-custom:hover,
.topics-listing-page .custom-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.3);
}

/* Block images */
.topics-listing-page .block-image {
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer */
.topics-listing-page .site-footer {
    background: transparent;
    color: white;
    margin-top: 60px;
}

.topics-listing-page .site-footer-title {
    color: white;
    font-weight: 700;
}

.topics-listing-page .site-footer-link {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.topics-listing-page .site-footer-link:hover {
    color: white;
}

.topics-listing-page .copyright-text {
    color: rgba(255, 255, 255, 0.8);
}

.topics-listing-page .copyright-text a {
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .topics-listing-page .fixed-logo-bg {
        width: 100%;
        opacity: 0.02;
    }
    
    .topics-listing-page .site-header h2 {
        font-size: 1.8rem;
    }
    
    .topics-listing-page .custom-block-topics-listing {
        padding: 1.5rem;
    }
    
    .topics-listing-page section h2 {
        font-size: 1.5rem;
    }
}

/* ========================================
   DARK MODE SUPPORT - FIXED
   ======================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #0f0f0f;
        --card-bg: #1a1a1a;
        --text-primary: #f5f5f5;
        --text-secondary: #b0b0b0;
        --text-light: #808080;
        --border-light: #2d2d2d;
    }

    body {
        background-color: #0f0f0f;
        color: #f5f5f5;
    }

    .navbar {
        background: rgba(26, 26, 26, 0.9);
        border-bottom-color: #2d2d2d;
    }

    .navbar-brand {
        background: linear-gradient(135deg, #4db8ff, #0066ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .navbar-nav .nav-link {
        color: #b0b0b0 !important;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        color: #4db8ff !important;
    }

    .navbar-nav .nav-link::after {
        background: linear-gradient(90deg, #4db8ff, #0066ff);
    }

    .navbar-icon {
        background: #2d2d2d;
        color: #4db8ff;
    }

    .navbar-icon:hover {
        background: #0066ff;
        color: white;
    }

    .card,
    .feature-card,
    .custom-block,
    .timeline-content {
        background: #1a1a1a;
        border-color: #2d2d2d;
        color: #f5f5f5;
    }

    .card-header {
        background: rgba(45, 45, 45, 0.5);
        border-bottom-color: #2d2d2d;
    }

    .card-text,
    .feature-card p,
    .custom-block-description,
    .timeline-content p {
        color: #b0b0b0;
    }

    .card-title,
    .feature-card h3,
    .custom-block-title,
    .timeline-content h4 {
        color: #f5f5f5;
    }

    .feature-icon {
        background: linear-gradient(135deg, #0066ff, #0052cc);
    }

    .custom-block-category {
        background: rgba(0, 102, 255, 0.2);
        color: #4db8ff;
    }

    .custom-block-footer {
        border-top-color: #2d2d2d;
    }

    .section-title h2 {
        color: #f5f5f5;
    }

    .section-title p {
        color: #b0b0b0;
    }

    .section-title h2::after {
        background: linear-gradient(90deg, #0066ff, #0052cc);
    }

    .timeline-content {
        border-left-color: #0066ff;
    }

    .timeline-dot {
        background: linear-gradient(135deg, #0066ff, #0052cc);
        box-shadow: 0 0 0 12px #1a1a1a, 0 0 0 14px #2d2d2d;
    }

    .form-label {
        color: #f5f5f5;
    }

    .form-control,
    .form-select,
    textarea {
        background: #1a1a1a;
        border-color: #2d2d2d;
        color: #f5f5f5;
    }

    .form-control::placeholder,
    textarea::placeholder {
        color: #808080;
    }

    .form-control:focus,
    .form-select:focus,
    textarea:focus {
        border-color: #0066ff;
        box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.2);
        background: #1a1a1a;
    }

    /* Dark mode dropdown menus */
    .dropdown-menu {
        background: #1a1a1a;
        border-color: #2d2d2d;
    }

    .dropdown-item {
        color: #b0b0b0;
        background: transparent;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: rgba(0, 102, 255, 0.1);
        color: #4db8ff;
    }

    .dropdown-item.active,
    .dropdown-item:active {
        background-color: #0066ff;
        color: white;
    }

    .site-footer {
        background: rgba(10, 10, 10, 0.9);
        border-top: 1px solid #2d2d2d;
    }

    .topics-listing-page .site-footer {
        background: rgba(10, 10, 10, 0.9);
        color: #e8eef7;
    }

    .footer-section h6 {
        color: #f5f5f5;
    }

    .footer-link {
        color: #999999;
    }

    .footer-link:hover {
        color: #4db8ff;
    }

    .footer-divider {
        background: rgba(255, 255, 255, 0.1);
    }

    .footer-bottom {
        color: #808080;
    }

    .social-link {
        background: rgba(255, 255, 255, 0.05);
        border-color: #2d2d2d;
        color: #4db8ff;
    }

    .social-link:hover {
        background: #0066ff;
        border-color: #0066ff;
        color: white;
    }

    .featured-section {
        background: #0f0f0f;
    }

    .featured-section::before {
        background: rgba(255, 255, 255, 0.03);
    }

    .timeline-section {
        background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
    }

    .hero-section {
        background: linear-gradient(135deg, #0052cc, #0066ff);
    }

    .hero-section h1,
    .hero-section p {
        color: white;
    }

    /* Footer text colors for dark mode */
    .site-footer-title {
        color: #f5f5f5 !important;
    }

    .site-footer-link {
        color: #a0a0a0 !important;
    }

    .site-footer-link:hover {
        color: #4db8ff !important;
    }

    .site-footer p {
        color: #a0a0a0;
    }

    .copyright-text {
        color: #808080 !important;
    }

    .copyright-text a {
        color: #4db8ff !important;
    }

    /* Dark mode for topics listing page */
    .topics-listing-page {
        background: #0a0a0a;
        color: #f5f5f5;
    }

    .topics-listing-page .navbar {
        background: #1a1a1a;
        border-bottom-color: #2d2d2d;
    }

    .topics-listing-page .navbar-nav .nav-link {
        color: #b0b0b0 !important;
    }

    .topics-listing-page .navbar-nav .nav-link:hover {
        color: #4db8ff !important;
    }

    .topics-listing-page .site-header {
        background: #1a1a1a;
        border-bottom-color: #2d2d2d;
    }

    .topics-listing-page .site-header h2 {
        color: #f5f5f5;
    }

    .topics-listing-page .breadcrumb-item.active {
        color: #a0a0a0;
    }

    .topics-listing-page section {
        background: #0a0a0a;
    }

    .topics-listing-page section h2,
    .topics-listing-page section h3,
    .topics-listing-page section h4 {
        color: #f5f5f5;
    }

    .topics-listing-page .section-padding:nth-of-type(even) {
        background: #151515;
    }

    .topics-listing-page .custom-block-topics-listing {
        background: #1a1a1a;
        border-left-color: #4db8ff;
    }

    .topics-listing-page .custom-block-topics-listing h4 {
        color: #4db8ff;
    }

    .topics-listing-page .custom-block-topics-listing p {
        color: #a0a0a0;
    }

    .topics-listing-page p {
        color: #a0a0a0;
    }

    .topics-listing-page .text-secondary {
        color: #808080 !important;
    }

    .topics-listing-page .block-image {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .topics-listing-page .fixed-logo-bg {
        opacity: 0.08;
    }
}
