/* ======================================= */
/* ---   THEME VARIABLES               --- */
/* ======================================= */

:root {
    /* --- Light Mode (Default) --- */
    --bs-body-bg: #ffffff;

    /* UPDATED: Brand "Midnight Blue" for text instead of Grey/Black */
    --bs-body-color: #0c1844;

    /* Brand Colors */
    --brand-red: #c80036;
    --brand-red-hover: #d62828;

    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa; /* Light Gray */
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-nav-mobile: rgba(255, 255, 255, 0.98);

    /* Text */
    /* UPDATED: Main text is now your brand blue */
    --text-main: #0c1844;
    --text-muted: #6c757d;
    --text-inverse: #ffffff;

    /* UI Elements */
    --border-color: rgba(12, 24, 68, 0.1); /* Adapted border to be subtle blue */
    --input-bg: #ffffff;
    --input-border: #ced4da;

    /* Gradients / Overlays */
    --overlay-start: rgba(255, 255, 255, 0.97);
    --overlay-end: rgba(255, 255, 255, 0.88);
    --overlay-middle: rgba(255, 255, 255, 0.85);
    --overlay-bottom: #ffffff;

    /* Shadows */
    --shadow-soft: 0 10px 30px rgba(12, 24, 68, 0.08); /* Blue-tinted shadow */
}

[data-bs-theme="dark"] {
    /* --- Dark Mode --- */
    --bs-body-bg: #0d1218;
    --bs-body-color: #ffffff;

    /* Backgrounds */
    --bg-primary: #0d1218;
    --bg-secondary: #121820;
    --bg-tertiary: #1a1d21;
    --bg-card: #1a222c;
    --bg-nav-mobile: rgba(13, 18, 24, 0.98);

    /* Text */
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-inverse: #212529;

    /* UI Elements */
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: #121820;
    --input-border: rgba(255, 255, 255, 0.1);

    /* Gradients / Overlays */
    --overlay-start: rgba(13, 18, 24, 0.95);
    --overlay-end: rgba(13, 18, 24, 0.8);
    --overlay-middle: rgba(13, 18, 24, 0);
    --overlay-bottom: rgba(13, 18, 24, 0.95);

    /* Shadows */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.4);
}

/* --- General Styling --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ensure Headings specifically use the main text color */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    color: var(--text-main);
}

/* --- Navigation Layout --- */
nav.navbar {
    position: absolute; /* Overlays the hero image */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 600;
    color: var(--text-main);
    opacity: 0.8;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-red) !important;
    opacity: 1;
}

/* Force nav links to be visible on dark mode hero backgrounds if needed */
[data-bs-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.8);
}
[data-bs-theme="dark"] .nav-link:hover {
    color: #ffffff !important;
}

/* --- Logo Switching Logic --- */
.logo-light { display: block; }
.logo-dark { display: none; }

[data-bs-theme="dark"] .logo-light { display: none; }
[data-bs-theme="dark"] .logo-dark { display: block; }


/* --- Hero Section --- */
.hero-section {
    position: relative;
    height: 60vh;
    min-height: 700px;
    background-image: url('/img/circuitboard-background.avif');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    padding-top: 90px; /* Navbar offset */
    box-sizing: border-box;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--overlay-start) 0%, var(--overlay-end) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-text-column h1 {
    line-height: 1.2;
    color: var(--text-main);
}

.text-highlight {
    color: var(--brand-red);
}

.lead {
    color: var(--text-muted) !important;
    font-weight: 400;
}

.text-white-50 {
    color: var(--text-muted) !important;
}

/* --- Buttons --- */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-custom-red {
    background-color: var(--brand-red);
    color: #fff;
}

.btn-custom-red:focus,
.btn-custom-red:hover {
    background-color: var(--brand-red-hover);
    color: #fff;
    transform: translateY(-2px);
}

.btn-custom-outline {
    background-color: transparent;
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-custom-outline:focus,
.btn-custom-outline:hover {
    background-color: var(--text-main);
    border-color: var(--text-main);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

/* --- Project Cards --- */
.featured-projects {
    background-color: var(--bg-secondary);
    padding: 100px 0;
    position: relative;
}

.view-all-link {
    color: var(--brand-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card .card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

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

.project-card .details-link {
    color: var(--brand-red);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start;
}

/* --- Services Section --- */
.services-section {
    background-color: var(--bg-secondary);
    padding: 100px 0;
}

.service-card {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    height: 100%;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--brand-red);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--brand-red);
    margin-bottom: 20px;
}

.service-card h5 {
    color: var(--text-main);
}

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

/* --- Industries Section --- */
.industries-section {
    background-color: var(--bg-card);
    padding: 100px 0;
}

.industry-item {
    text-align: center;
}

.industry-logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 5px;
    transition: all 0.3s ease;
}

.industry-item:hover .industry-logo {
    border-color: var(--brand-red);
    transform: scale(1.05);
}

.industry-item h5 {
    color: var(--text-main);
}

/* --- Inner Page Hero Sections --- */
.contact-hero-section, .about-hero-section, .jobs-hero-section, .case-study-hero-section, .admin-hero-section {
    position: relative;
    padding: 100px 0;
    padding-top: 90px;
    background-color: var(--bg-secondary);
    background-size: cover;
    background-position: center;
}

/* Background Images */
.contact-hero-section { background-image: url('/img/contact-hero.jpeg'); }
.about-hero-section { background-image: url('/img/cool-lighting-laptop.png'); }
.jobs-hero-section { background-image: url('/img/laptop-with-red-keys.jpeg'); }
.case-study-hero-section { background-image: url('/img/case-studies.jpeg'); display: flex; align-items: center; }
.admin-hero-section { background-image: url('/img/admin-hero.jpeg'); }

/* Fade Overlay for Inner Heros */
.contact-hero-section::before,
.about-hero-section::before,
.jobs-hero-section::before,
.case-study-hero-section::before,
.admin-hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        to bottom,
        var(--overlay-start) 0%,
        var(--overlay-middle) 50%,
        var(--overlay-bottom) 100%
    );
    z-index: 2;
}

/* Dark Mode Gradient Override */
[data-bs-theme="dark"] .contact-hero-section::before,
[data-bs-theme="dark"] .about-hero-section::before,
[data-bs-theme="dark"] .jobs-hero-section::before,
[data-bs-theme="dark"] .case-study-hero-section::before,
[data-bs-theme="dark"] .admin-hero-section::before {
    background: linear-gradient(
        to bottom,
        var(--overlay-start) 0%,
        var(--overlay-middle) 50%,
        var(--overlay-bottom) 100%
    );
}

.contact-hero-section .container,
.about-hero-section .container,
.jobs-hero-section .container,
.case-study-hero-section .container,
.admin-hero-section .container {
    position: relative;
    z-index: 3;
}

/* --- Contact & Forms --- */
.contact-section {
    background-color: var(--bg-primary);
    padding: 100px 0;
}

.contact-info-item .contact-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(200, 0, 54, 0.1);
    color: var(--brand-red);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin-right: 20px;
}

.social-icons .social-icon-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    text-decoration: none;
    margin-right: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.social-icons .social-icon-link:hover {
    background-color: var(--brand-red);
    color: #ffffff;
    border-color: var(--brand-red);
    transform: translateY(-3px);
}

/* Form Wrapper */
.contact-form-wrapper, .contact-form-wrapper-boxed {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.contact-form-wrapper .form-label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.contact-form-wrapper .form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form-wrapper .form-control:focus {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-color: var(--brand-red);
    box-shadow: 0 0 0 0.25rem rgba(200, 0, 54, 0.25);
}

/* --- Tables --- */
.table {
    --bs-table-bg: var(--bg-card);
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
}

.table thead {
    background-color: var(--brand-red);
    color: #ffffff;
}

.table thead th {
    background-color: var(--brand-red);
    color: #ffffff;
    border: none;
}

.job-link {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
}

.job-link:hover {
    color: var(--brand-red);
    text-decoration-color: var(--brand-red);
}

.job-listings-section .table-hover tbody tr:hover {
    color: #ffffff; /* Make general text white on hover */
}

/* Make the specific link white on hover so it stands out against the dark grey row */
.job-listings-section .table-hover tbody tr:hover .job-link {
    color: #ffffff;
    text-decoration-color: #ffffff;
}

/* --- Footer --- */
.footer-section {
    background-color: #121820; /* Keep footer dark by default */
    color: #ffffff;
}

/* Light Mode specific footer override */
[data-bs-theme="light"] .footer-section {
    background-color: #f8f9fa;
    color: #212529;
}

[data-bs-theme="light"] .footer-section p,
[data-bs-theme="light"] .footer-section li,
[data-bs-theme="light"] .footer-section a {
    color: #6c757d;
}

/* FIX: Target both the tag h5 AND the class .h5 */
[data-bs-theme="light"] .footer-section h5,
[data-bs-theme="light"] .footer-section .h5 {
    color: var(--text-main);
}

/* --- Animation Class --- */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) {
    nav.navbar {
        position: static; /* Revert overlay on mobile */
    }

    .hero-section, .about-hero-section {
        padding-top: 2rem;
    }

    .navbar-collapse {
        background-color: var(--bg-nav-mobile);
        padding: 1.5rem;
        margin-top: 1rem;
        border-radius: 15px;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-soft);
    }
}

/* ... existing styles ... */

/* ======================================= */
/* ---   ANIMATION REFINEMENTS         --- */
/* ======================================= */

/* Override Animate.css defaults for a more professional feel */
:root {
  --animate-duration: 0.8s; /* Standardize speed */
}

/* Ensure elements hidden via Alpine/JS don't flash */
.opacity-0 {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

/* If the user prefers reduced motion (OS setting), disable animations */
@media (prefers-reduced-motion: reduce) {
  .animate__animated {
    /* CSS transitions are disabled */
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  .opacity-0 {
      opacity: 1 !important;
  }
}

/* ======================================= */
/* ---   CASE STUDY CTA SECTION        --- */
/* ======================================= */

.cta-section-case-study {
    /* Always keep the dark background for this card to make it stand out */
    background-color: #2a313a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Force text inside this specific card to be white, even in Light Mode */
.cta-section-case-study h3,
.cta-section-case-study .h3,
.cta-section-case-study p {
    color: #ffffff !important;
}

.cta-section-case-study .text-white-50 {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* --- Sparkle Button Styles --- */
.btn-cta-sparkle {
    position: relative;
    background-color: #ffffff;
    color: var(--brand-red);
    border-radius: 12px;
    padding: 12px 28px;
    font-weight: 700;
    border: 3px solid var(--brand-red);
    transition: all 0.3s ease;
    text-transform: capitalize;
    text-decoration: none;
    display: inline-block;
}

.btn-cta-sparkle:focus,
.btn-cta-sparkle:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(200, 0, 54, 0.4);
    background-color: #ffffff;
    color: var(--brand-red-hover);
    border-color: var(--brand-red-hover);
}

/* Sparkles using inline SVG */
.btn-cta-sparkle::before,
.btn-cta-sparkle::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    /* CHANGED: fill='white' (was %23c80036) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 0l-2.5 9.5-9.5 2.5 9.5 2.5 2.5 9.5 2.5-9.5 9.5-2.5-9.5-2.5z'/%3E%3C/svg%3E");
    animation: sparkle-animation 2s ease-in-out infinite;
    pointer-events: none;
}

/* Positioning the left sparkle */
.btn-cta-sparkle::before {
    bottom: -12px;
    left: -8px;
}

/* Positioning the right sparkle */
.btn-cta-sparkle::after {
    top: -12px;
    right: -8px;
    animation-delay: -1s; /* Stagger the animation */
}

/* Keyframe animation for sparkle effect */
@keyframes sparkle-animation {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
  100% { transform: scale(0) rotate(90deg); opacity: 0; }
}

/* ======================================= */
/* ---   JOB CARDS                     --- */
/* ======================================= */

.job-card-grid {
    display: flex;
    flex-direction: column; /* Forces cards to stack vertically (Wide) */
    gap: 20px;
}

.job-listing-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Ensure the title link changes color on hover */
.job-listing-card h3 a {
    color: var(--text-main);
    transition: color 0.3s ease;
}

.job-listing-card h3 a:hover {
    color: var(--brand-red);
}

/* Update: Header Alignment */
.job-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* New: Ensure the info section takes available space so button pushes right */
.job-card-info {
    flex-grow: 1;
}

/* Helper for text reset */
.text-reset {
    color: inherit !important;
}

.job-listing-card:hover {
    transform: translateY(-3px); /* Subtle lift */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-color: var(--brand-red);
}

/* Header Area: Icon + Title */
.job-card-header {
    display: flex;
    align-items: center; /* Center align icon with text */
    margin-bottom: 15px;
}

/* The colored square box for the icon */
.job-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 1.75rem;
}

/* Color Classes (Matches Model Choices) */
.bg-brand-red { background-color: var(--brand-red); }
.bg-midnight-blue { background-color: #0c1844; }
.bg-slate { background-color: #6c757d; }
.bg-teal { background-color: #007d7e; }

/* Job Info */
.job-card-info h3 {
    font-size: 1.35rem; /* Slightly larger title for wide cards */
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-main);
}

.job-location {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Description */
.job-card-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.6;
    max-width: 90%; /* Keeps text from stretching too long on huge screens */
}

/* Pills (Tech Stack) */
.job-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.tech-pill {
    background-color: var(--bg-tertiary);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .job-listing-card {
        padding: 20px;
    }
}

/* ======================================= */
/* ---   BENEFITS SECTION              --- */
/* ======================================= */

.benefits-section {
    background-color: #121820; /* Always keep this dark for visual interest */
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.benefits-section h2,
.benefits-section .display-4 {
    color: #ffffff !important;
}

/* Background Decorations (Glow effects) */
.benefits-section::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -200px;
    width: 800px;
    height: 400px;
    background-image:
        radial-gradient(circle at top right, #f77f00 0%, transparent 40%),
        radial-gradient(circle at top right, #005f73 0%, transparent 50%);
    opacity: 0.3;
    z-index: 1;
    pointer-events: none;
}

.benefits-section .container {
    position: relative;
    z-index: 2;
}

/* List Styling with Custom Bullets */
.benefits-list {
    list-style: none; /* Remove default browser bullets */
    padding-left: 0;
    margin-top: 2rem;
}

.benefits-list li {
    font-size: 1.15rem;
    padding-left: 35px; /* Create space for the custom bullet */
    position: relative;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* The Red Dot Bullet */
.benefits-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: -6px; /* Adjust vertical align */
    color: var(--brand-red);
    font-size: 2rem;
    line-height: 1;
}

/* --- Image Collage Styling --- */
.image-collage {
    position: relative;
    height: 450px;
    width: 100%;
}

.image-collage img {
    position: absolute;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 4px solid #fff;
    object-fit: cover; /* Ensures images fill their box without stretching */
}

/* Position 1: Top Right (Landscape) */
.benefit-img-1 {
    top: 0;
    right: 0;
    z-index: 3;
    width: 55%;
    height: 200px;
}

/* Position 2: Middle Left (Wide) */
.benefit-img-2 {
    top: 35%;
    left: 0;
    z-index: 2;
    width: 50%;
    height: 220px;
}

/* Position 3: Bottom Right (Square-ish) */
.benefit-img-3 {
    bottom: 0;
    right: 10%;
    z-index: 4;
    width: 45%;
    height: 200px;
}

/* Responsive Fallback for Mobile/Tablet */
@media (max-width: 992px) {
    .image-collage {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-top: 40px;
    }

    .image-collage img {
        position: relative;
        width: 100%;
        height: 300px;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        border-width: 2px;
    }
}

/* --- Culture Cards --- */
.culture-cards-section .job-listing-card {
    justify-content: flex-start; /* Aligns content to the top */
    gap: 1rem; /* Adds consistent space between header and text */
}

.values-list ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.values-list li {
    margin-bottom: 0.5rem;
}

/* --- Hiring Process --- */
.hiring-process-section {
    background-color: var(--bg-card); /* Alternate background */
}

/* Ensure process content is readable */
.process-content p {
    margin-bottom: 1.5rem;
}

/* Utility: Background Colors that adapt to theme */
.bg-darker {
    background-color: var(--bg-tertiary) !important;
}

/* Ensure text contrast is correct inside this section */
.bg-darker p,
.bg-darker h3 {
    color: var(--text-main);
}

/* ======================================= */
/* ---   PARTNER PROGRAM PAGE          --- */
/* ======================================= */
.partners-hero-section {
    position: relative;
    /* INCREASED padding-top to 180px to uncrowd the header */
    padding-top: 180px;
    padding-bottom: 100px;
    background-size: cover;
    background-position: center;
}

/* Dark overlay covering the whole image to ensure text pops */
.partners-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.85));
    z-index: 1;
}

/*
   White top-down fade for the Navbar.
   This sits BEHIND the navbar but ON TOP of the dark hero image.
   It creates a light backdrop so the dark Light-Mode text is readable.
*/
.partners-navbar-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* INCREASED height to 200px so logo is clearer */
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* In Dark Mode, text is white, so we hide the white fade to let it sit on the dark image */
[data-bs-theme="dark"] .partners-navbar-fade {
    opacity: 0;
}

/* Content Positioning */
.partner-hero-content {
    position: relative;
    z-index: 3;
}

/* Typography Overrides for the Hero */
.partner-hero-title {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.partner-hero-lead {
    max-width: 800px;
    margin: 1rem auto 0;
    color: #ffffff !important; /* Force white over global .lead */
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.partner-hero-btn {
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important;
}

.partner-hero-btn.btn-outline-light {
    border: 2px solid #ffffff !important; /* Force the border to be visible */
    color: #ffffff;
}

.partner-hero-btn.btn-outline-light:hover {
    background-color: #ffffff;
    color: #000000; /* Dark text on hover */
}

/* ======================================= */
/* ---   DARK MODE ADAPTIVE UTILITIES  --- */
/* ======================================= */

/* Use this instead of bg-white */
.bg-adaptive-primary {
    background-color: var(--bg-primary) !important;
}

/* Use this instead of bg-light */
.bg-adaptive-secondary {
    background-color: var(--bg-secondary) !important;
}

/* Ensure text-muted uses the variable that adjusts for dark mode */
.text-muted {
    color: var(--text-muted) !important;
}

/* Specific fix for Partner Benefits Cards */
/* In light mode, we want them slightly grey (secondary).
   In dark mode, we want them slightly lighter than the black background (card color). */
.partner-card-bg {
    background-color: var(--bg-secondary);
}

[data-bs-theme="dark"] .partner-card-bg {
    background-color: var(--bg-card);
    border-color: var(--border-color) !important;
}

/* ======================================= */
/* ---         PARTNER PORTAL          --- */
/* ======================================= */

/* Remove rounded corners from the portal table */
.table-flat {
    border-radius: 0 !important;
}

/* Ensure the header cells themselves don't hold onto the radius */
.table-flat thead th:first-child {
    border-top-left-radius: 0 !important;
}
.table-flat thead th:last-child {
    border-top-right-radius: 0 !important;
}

/* Logo sizing for the portal navbar */
.portal-logo {
    height: 40px;
    width: auto;
    margin-right: 15px;
}

/* ======================================= */
/* ---   PORTAL & AUTH LAYOUT          --- */
/* ======================================= */

/* Replaces: style="min-height: 70vh; display: flex; align-items: center;" */
.portal-auth-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Replaces: style="min-height: 80vh;" */
.portal-min-height {
    min-height: 80vh;
}

/* Replaces: style="height: 30px;" */
.portal-brand-divider {
    height: 30px;
}

/* Replaces: style="width: 60px; height: 60px; font-size: 1.5rem;" */
.process-step-circle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

/* For password reset confirmation cards */
.auth-card-wrapper {
    max-width: 500px;
}

/* For the large checkmark icon */
.icon-lg-success {
    font-size: 4rem;
}

/* For the "Partner Portal" text in navbar */
.portal-nav-text {
    font-size: 1.1rem;
}

/* For dashboard container height */
.dashboard-container {
    min-height: 80vh;
}

/* For the "No Profile" page alignment */
.flex-column-center {
    flex-direction: column;
    justify-content: center;
}

/* ======================================= */
/* ---   BLOG SECTION STYLES           --- */
/* ======================================= */

.blog-hero-section {
    position: relative;
    /* Increase padding to clear the navbar */
    padding-top: 180px;
    padding-bottom: 100px;
    background-size: cover;
    background-position: center;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    /* Dark overlay for text readability */
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.8));
    z-index: 1;
}

/* Top-down white fade for navbar visibility in Light Mode */
.blog-navbar-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Hide fade in Dark Mode (text becomes white) */
[data-bs-theme="dark"] .blog-navbar-fade {
    opacity: 0;
}

.blog-hero-content {
    position: relative;
    z-index: 3;
}

/* Force white text for the lead paragraph in the hero */
.blog-hero-lead {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    max-width: 800px;
    margin: 1rem auto 0;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    /* Increased opacity of the dark overlay for better text contrast */
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Updated Fade: Stronger white at the top for navbar readability */
.blog-navbar-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    /* Changed starts from 0.95 to 1 (solid) and stays white longer (40%) before fading */
    background: linear-gradient(to bottom, rgba(255,255,255,1) 0%, rgba(255,255,255,0.8) 35%, rgba(255,255,255,0) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Ensure the custom class definitely forces white with a shadow */
.blog-header-text {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); /* Stronger shadow */
}

.blog-meta-text {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    font-weight: 500;
}

/* For Blog Index badges */
.badge-sm {
    font-size: 0.7rem;
}

/* For Blog Post Header Section */
.blog-article-header {
    background-color: #1a1d21;
    padding-top: 140px;
    padding-bottom: 80px;
    position: relative;
}

/* For Blog Post Background Image Overlay */
.blog-article-bg {
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Explicit z-index helper */
.z-index-2 {
    z-index: 2;
    position: relative;
}

/* Bottom fade to smooth transition from Hero to Content */
.blog-header-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 350px; /* Adjust height for softness */
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, #ffffff 100%);
    z-index: 2;
    pointer-events: none;
}

/* Dark mode variant (fades to dark bg) */
[data-bs-theme="dark"] .blog-header-fade-bottom {
    background: linear-gradient(to bottom, rgba(13, 18, 24, 0) 0%, #0d1218 100%);
}

/* ======================================= */
/* ---   BLOG CARD INTERACTIONS        --- */
/* ======================================= */

.blog-card {
    /* Set an initial subtle border so the layout doesn't jump on hover */
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.blog-card:hover {
    /* The "Raise" effect */
    transform: translateY(-5px);
    /* The "Red Outline" effect */
    border-color: var(--brand-red);
    /* Stronger shadow on lift */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

/* Dark mode adjustment for the initial border */
[data-bs-theme="dark"] .blog-card {
    border-color: var(--border-color);
    background-color: var(--bg-card);
}

/* ======================================= */
/* ---   TEAM SECTION STYLES           --- */
/* ======================================= */

.team-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-red);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.team-social-link {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.team-social-link:hover {
    color: #0077b5; /* LinkedIn Blue */
}

/* ======================================= */
/* ---   STATS GRID BLOCK              --- */
/* ======================================= */

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color) !important;
}

.stat-number {
    color: var(--brand-red);
}
