/* ============================================================= */
/*  PREMIUM 2025 REDESIGN – BLUE + GREEN + ORANGE LUXE THEME   */
/*  Clean, modern, glassmorphic, high-end 3D marketplace vibe  */
/* ============================================================= */

/* Removed external Google Fonts import to standardize on system font Arial */

:root {
    --blue-joy:     #00D4FF;
    --green-happy:  #00FF88;
    --orange-fun:   #FF9F1C;
    --deep-blue:    #0066FF;
    --dark:         #0F172A;
    --light:        #F8FAFC;
    --gray-100:     #F1F5F9;
    --gray-200:     #E2E8F0;
    --gray-700:     #334155;
    --gradient:     linear-gradient(135deg, #00D4FF 0%, #00FF88 50%, #FF9F1C 100%);
    --shadow-sm:    0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-md:    0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg:    0 20px 50px rgba(0, 212, 255, 0.15);
    --radius:       16px;
    --radius-sm:    12px;
    /* Typography scale */
    --font-sans:    Arial, Helvetica, sans-serif;
    --font-size-base: 1rem;    /* 16px default */
    --font-size-sm:   0.95rem;
    --font-size-lg:   1.1rem;
    --line-height-base: 1.6;
}

@media (max-width: 768px) {
    :root {
        --font-size-base: 1.1rem;
        --font-size-sm:   1.05rem;
        --font-size-lg:   1.2rem;
    }
}

html.dark-mode {
    background: #000000;
}
body.dark-mode {
    --dark:         #FFFFFF;
    --light:        #000000;
    --gray-100:     #111111;
    --gray-200:     #222222;
    --gray-700:     #CCCCCC;
    --blue-joy:     #38BDF8;
    --green-happy:  #4ADE80;
    --deep-blue:    #60A5FA;
}
body.dark-mode .text-dark {
    color: #FFFFFF !important;
}
body.dark-mode .text-muted {
    color: #AAAAAA !important;
}
body.dark-mode .btn-outline-dark {
    color: #FFFFFF;
    border-color: #FFFFFF;
}
body.dark-mode .btn-outline-dark:hover {
    background-color: #FFFFFF;
    color: #000000;
}
body.dark-mode .table-light {
    background-color: #000000 !important;
    color: #FFFFFF !important;
}
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--dark);
}
body.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--dark);
}
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
body.dark-mode .bg-light {
    background-color: #000000 !important;
}
body.dark-mode .bg-white {
    background-color: #000000 !important;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Move the gradient to the root html element so a semi-transparent
   site-wide background image layer can sit above it but behind content. */
html {
    background: linear-gradient(135deg, #E0F8FF 0%, #E8FFF6 50%, #FFF4E6 10%);
    background-attachment: fixed;
    min-height: 100%;
}
body {
    /* Global font set to Arial across the app */
    font-family: var(--font-sans);
    /* Transparent background so the image layer shows above the gradient */
    background: transparent;
    color: var(--dark);
    line-height: var(--line-height-base);
    font-size: var(--font-size-base);
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

/* Safety: ensure default left-to-right and left alignment site-wide */
html, body { direction: ltr; text-align: left; }
/* Guard: main content should not inherit unexpected text centering from components */
.main-content { text-align: left; }

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    color: #FFFFFF;
    background-image: url('/static/images/hero_bg.jpg');
    background-size: cover;
    background-position: center 65%; /* Focus on the 3D printed object */
    background-repeat: no-repeat;
    margin-bottom: 2rem;
    border-radius: var(--radius);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Dark overlay to make white text readable */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #FFFFFF; /* Override heading color */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.5rem;
    line-height: 1.4;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.3rem;
    }
    .hero-section {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .features-title {
        font-size: 2.2rem;
    }
    .features-subtitle {
        font-size: 1.3rem;
    }
    .step-title {
        font-size: 1.6rem;
    }
    .step-text {
        font-size: 1.1rem;
    }
}

/* Steps Section */
.steps-section {
    padding: 2rem 0;
    margin-bottom: 4rem;
}

.features-gray-section {
    background-color: #FFFFFF;
    padding: 4rem 20px;
    text-align: center;
    margin-bottom: 3rem;
    border-radius: var(--radius);
}
.dark-mode .features-gray-section {
    background-color: #000000;
}

.features-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

.features-subtitle {
    font-size: 1.2rem;
    color: var(--gray-700);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
}

.step-column {
    text-align: center;
}

.step-image {
    width: 100%;
    aspect-ratio: 2/3; /* Matching the vertical-ish nature of the provided photos */
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.step-text {
    font-size: 1rem;
    color: var(--gray-700);
    line-height: 1.4;
}

@media (max-width: 992px) {
    .steps-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Material Tool Section (matches Hero Section sizing) */
.material-tool-section {
    position: relative;
    min-height: 700px;
    height: auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #000000; /* Black background card */
    margin: 4rem 0;
    padding: 5rem 0;
    border-radius: var(--radius);
}

.material-tool-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1000px;
    padding: 0 40px;
}

/* Custom range sliders for dark background */
.custom-dark-range::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.2);
}
.custom-dark-range::-moz-range-track {
    background: rgba(255, 255, 255, 0.2);
}
.custom-dark-range::-webkit-slider-thumb {
    background: var(--blue-joy);
}
.custom-dark-range::-moz-range-thumb {
    background: var(--blue-joy);
}

.glow-text {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .material-tool-section {
        height: auto;
        padding: 4rem 0;
    }
}

/* Full-page background image layer (30% opacity). The image is provided
   via uploads and spans edge-to-edge behind all content. */
.site-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Served via Flask route /project_image/<filename> */
    /*background-image: url('/project_image/SAME_SAME.jpeg');*/
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3; /* 30% visible */
    pointer-events: none; /* allow clicks through */
    z-index: -1; /* behind the app content */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    /* Headings also use Arial to keep typography consistent */
    font-family: var(--font-sans);
    color: var(--deep-blue);
    line-height: 1.2;
}
.display-5 { font-size: 3.5rem; }
.lead { font-size: 1.25rem; font-weight: 400; }

/* Glassmorphic Cards */
.card, .file-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}
.dark-mode .card, .dark-mode .file-card {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.1);
}
.card:hover, .file-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-lg);
    border-color: var(--blue-joy);
}

/* Buttons – Solid colors (no rainbow/gradient overlay) */
.btn {
    border: none;
    border-radius: 50px;
    padding: 14px 32px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden; /* safe for ripple effects if added later */
    z-index: 1;
    transition: all 0.4s ease;
}
.btn:hover { color: white; transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn-primary   { background: var(--deep-blue); color: white; }
.btn-success   { background: var(--green-happy); color: var(--dark); }


/* Custom Register Button Style */
.btn-register-hero {
    background-color: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
    border-radius: 8px;
    padding: 12px 60px;
    min-width: 250px;
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 500;
}

.btn-register-hero:hover {
    background-color: #6c757d;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-primary {
    border: 2px solid var(--deep-blue);
    color: var(--deep-blue);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--deep-blue);
    color: white;
}

/* ========================= */
/* Transactions Table Theme  */
/* Blue, Orange, Grey scheme */
/* ========================= */
.transactions-table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.dark-mode .transactions-table {
    background: #000000;
}
.transactions-table thead th {
    background: var(--deep-blue);
    color: #fff;
    border: none;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.transactions-table tbody tr {
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.transactions-table tbody tr:nth-child(even) {
    background: var(--gray-100);
}
.transactions-table tbody tr:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.transactions-table td, .transactions-table th {
    vertical-align: middle;
}

/* Status badges (mapped in template) */
.status-badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.25px;
}
.status-badge.badge-blue {
    background: var(--deep-blue);
    color: #fff;
}
.status-badge.badge-orange {
    background: var(--orange-fun);
    color: #1b1b1b;
}
.status-badge.badge-grey {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Monospace helper for IDs */
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95rem;
    word-break: break-all;
}

/* ------------------------------------------------------------- */
/* Tabs (Project Details)                                        */
/* Make tabs white for legibility; active tab light grey similar */
/* to the "Overview: Project" header (table-light vibe).         */
/* ------------------------------------------------------------- */
/* Typography standardization across all tabs on the view project page */
.view-project .nav-tabs,
.view-project .nav-tabs .nav-link,
.view-project .tab-content,
.view-project .tab-pane {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

/* Base tab appearance */
.view-project .nav-tabs .nav-link {
    background: #ffffff;            /* white tabs by default */
    color: #000000;             /* dark text for readability */
    border: 1px solid var(--gray-200);
    margin-right: 2px;
}
.dark-mode .view-project .nav-tabs .nav-link {
    background: #000000;
}

/* Hover/focus stays white so labels remain readable */
.view-project .nav-tabs .nav-link:hover,
.view-project .nav-tabs .nav-link:focus {
    background: #ffffff;
    color: var(--dark);
}
.dark-mode .view-project .nav-tabs .nav-link:hover,
.dark-mode .view-project .nav-tabs .nav-link:focus {
    background: var(--gray-200);
}

/* Active tab: light grey similar to table-light header */
.view-project .nav-tabs .nav-link.active,
.view-project .nav-tabs .nav-item.show .nav-link {
    background: var(--gray-100);    /* light grey */
    color: var(--dark);
    border-color: var(--gray-200) var(--gray-200) transparent; /* blend with content border */
}
.dark-mode .view-project .nav-tabs .nav-link.active {
    background: #000000;
}

/* Ensure the content pane border lines up with the tabs */
.view-project .tab-content {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-top: 0;                  /* handled by the active tab */
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.dark-mode .view-project .tab-content {
    background: #000000;
}

/* Sidebar – Left vertical navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--shadow-sm);
    z-index: 1100;
    transform: translateX(0);
    transition: transform 0.3s ease;
}
.dark-mode .sidebar {
    background: rgba(0, 0, 0, 0.9);
    border-right-color: rgba(255, 255, 255, 0.1);
}
.sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: 1.25rem; gap: 1rem; }
.sidebar-brand a {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep-blue);
    text-decoration: none;
}
.sidebar-brand a:hover {
    color: var(--orange-fun);
}
.sidebar-brand .brand-accent { color: var(--orange-fun); }

.sidebar .nav-links { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.sidebar .nav-links a {
    display: block;
    color: var(--dark);
    font-weight: 600;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
}
.sidebar .nav-links a:hover {
    background: rgba(0, 212, 255, 0.12);
    color: var(--deep-blue);
    transform: translateX(4px);
}
.sidebar .nav-links a.active {
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,255,136,0.15));
    border: 1px solid rgba(0, 212, 255, 0.35);
}
.sidebar .unread-badge {
    top: 0.1rem; right: 0.4rem; transform: translate(50%, -50%);
}

/* Main content shifted to the right of the sidebar */
.main-content {
    margin-left: 260px;
    padding: 1.25rem;
    margin-top: 0; /* default */
    background-color: #FFFFFF;
}

body.dark-mode .main-content {
    background-color: #000000;
}

.main-content.no-sidebar {
    margin-left: 0;
    margin-top: 70px; /* Space for the top nav */
}

/* Top Nav Styles */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--shadow-sm);
    z-index: 1200;
    display: none; /* Only show on index page for now, or use logic to show everywhere if preferred */
}

.no-sidebar ~ .top-nav, 
body:has(.main-content.no-sidebar) .top-nav {
    display: block;
}

/* More robust way to show top-nav on index */
.main-content.no-sidebar ~ .top-nav { display: block; } /* This won't work if top-nav is above main */

/* Let's just use a class on body or just target it */
body:has(.no-sidebar) .top-nav { display: block; }

.top-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.top-nav-brand a {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep-blue);
    text-decoration: none;
}

.top-nav-brand a:hover {
    color: var(--orange-fun);
}

.top-nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-right: 40px; /* Offset for the theme toggle */
}

.top-nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.top-nav-links a:hover {
    color: var(--deep-blue);
}

.dark-mode .top-nav {
    background: rgba(0, 0, 0, 0.9);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Footer alignment so it doesn't sit under the fixed left sidebar/rail */
.app-footer {
    background-color: #FFFFFF;
}
@media (min-width: 992px) {
  .app-footer { margin-left: 260px; }
  .app-footer.has-status-rail { margin-left: calc(260px + 72px); }
  .no-sidebar ~ .app-footer,
  body:has(.no-sidebar) .app-footer { margin-left: 0; }
}
@media (max-width: 991.98px) {
  .app-footer { margin-left: 0; }
}
.dark-mode .app-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    background-color: #000000 !important;
}

/* Footnote styling for the proprietary disclaimer */
.app-footer .footnote {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.6;
}
.dark-mode .app-footer .footnote {
    color: var(--gray-700);
}
.app-footer .footnote-title {
    font-weight: 700;
    color: #444;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.dark-mode .app-footer .footnote-title {
    color: #FFFFFF;
}
.app-footer .footnote-title sup {
    color: #888;
    font-size: 0.8em;
}
.app-footer .footnote p {
    margin: 0.5rem 0;
}

/* Right-of-sidebar vertical status rail (for projects page) */
@media (min-width: 992px) {
  .status-rail {
    position: fixed;
    top: 0;
    left: 260px; /* sits immediately to the right of the left sidebar */
    height: 100vh;
    /* Fix a predictable width so main content can always clear it */
    width: 72px; /* was auto; fixed to ensure text is visible to the right */
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
    flex-direction: column;
    /* Stretch so each item can define the width based on its content */
    align-items: stretch;
    justify-content: flex-start;
    z-index: 1000; /* below hamburger (1200) and sidebar (1100) */

    /* Blend visually with the left sidebar */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--shadow-sm);
  }
  .dark-mode .status-rail {
    background: rgba(0, 0, 0, 0.9);
    border-left-color: rgba(255, 255, 255, 0.1);
}
  /* Nudge main content to the right when rail is present */
  .main-content.has-status-rail { margin-left: calc(260px + 72px); }
  .status-rail .rail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Let content define size; keep a reasonable minimum to match previous visuals */
    width: auto;
    min-width: 44px;
    height: auto;
    padding: 6px 8px;
    border-radius: 8px;
  }
  .status-rail .rail-label {
    background: transparent; /* blend with sidebar */
    color: var(--dark);
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1;
    text-align: center;
    /* vertical text */
    writing-mode: vertical-rl;
    /* make it read bottom to top like the mock */
    transform: rotate(180deg);
    letter-spacing: 0.5px;
    /* Prevent multi-column wrapping of long labels in vertical writing mode */
    white-space: nowrap;
    padding: 6px 0;
    border: none;
    box-shadow: none;
    user-select: none;
  }
  .status-rail .rail-label.active {
    background: rgba(0, 212, 255, 0.12);
    color: var(--deep-blue);
    border-radius: 8px;
    font-weight: 700;
  }
  /* Subtle hover to match sidebar links */
  .status-rail .rail-label:hover {
    background: rgba(0, 212, 255, 0.12);
    color: var(--deep-blue);
  }
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    width: 44px; height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1200;
    display: none; /* hidden on desktop */
    align-items: center; justify-content: center;
}
.sidebar-toggle .toggle-bar {
    display: block;
    width: 22px; height: 2px; background: var(--dark);
    margin: 3px 0; border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.sidebar-toggle.active .toggle-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.sidebar-toggle.active .toggle-bar:nth-child(2) { opacity: 0; }
.sidebar-toggle.active .toggle-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Responsive behavior: collapse sidebar on small screens */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; }
    .main-content { margin-left: 0; padding-top: 0; }
    body:has(.main-content.no-sidebar) .main-content { padding-top: 70px; }
    .top-nav { display: none; } /* Hide top nav on mobile by default */
    body:has(.main-content.no-sidebar) .top-nav { display: block; } /* Show only if it's the index page */
}

/* ========================= */
/* View Project layout fixes */
/* ========================= */
/* On large screens and above, make the left column a fixed/narrow rail and let the right fill */
@media (min-width: 992px) {
  .view-project .row.g-4 { flex-wrap: nowrap; }

  /* Left panel: cap at 350px and don't scale with the grid percentage */
  .view-project .vp-left {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 350px !important;
  }

  /* Right panel: take remaining space */
  .view-project .vp-right {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0; /* allow content to shrink within */
  }
}

/* ============================= */
/* Project Carousel – Fixed 325px */
/* ============================= */
/* Ensure the project image carousel is always 325px wide and centered, 
   while allowing surrounding layout to expand naturally. */
#projectCarousel {
    width: 325px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto; /* Centered by default on narrow screens */
    background-color: #f8f9fa; /* light gray background for carousel */
    border-radius: 0.5rem;
    padding: 0.5rem;
}
#projectCarousel .carousel-inner {
    width: 100%;
}
#projectCarousel .carousel-item img {
    width: 100%;
    height: auto;           /* keep natural aspect ratio */
    object-fit: contain;    /* avoid cropping if a fixed height is ever applied */
    display: block;
}
/* Keep controls and indicators within the fixed width */
#projectCarousel .carousel-control-prev,
#projectCarousel .carousel-control-next {
    width: 10%;
}
#projectCarousel .carousel-indicators {
    margin-bottom: 0.25rem; /* slightly tighter to the image */
}

/* ============================================= */
/* Left pane responsive behavior (side-by-side)  */
/* ============================================= */
/* Default stack on small screens */
.left-pane {
    display: block;
}

/* At ≥ 900px, place carousel at fixed 325px on the left,
   and let the rest of the left-column content expand rightwards */
@media (min-width: 900px) {
    .left-pane {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
    }
    /* Keep carousel + title in a fixed-width column */
    .carousel-column {
        flex: 0 0 325px;    /* fixed width slot for the carousel and its title */
    }
    #projectCarousel {
        margin-left: 0;     /* stop centering inside flex row */
        margin-right: 0;
    }
    .left-pane-body {
        flex: 1 1 auto;     /* expand to available width */
        min-width: 0;       /* prevent overflow in flex layout */
        width: 100%;        /* ensure it fills all available column width */
    }
    /* Ensure all cards/content in the left pane fill the available width */
    .left-pane-body > .card,
    .left-pane-body > .card .card-body,
    .left-pane-body > * {
        width: 100%;
        max-width: 100%;
    }
}
.nav-links a:hover {
    background: var(--blue-joy);
    color: white;
}

/* Prevent long tokens from breaking layout inside cards */
.card-body {
    overflow-wrap: anywhere;
}

/* (Removed) Custom 900px outer grid override; reverting to Bootstrap defaults */

/* Project Grid – Modern Masonry Feel */
.row-cols-md-3 > .col {
    margin-bottom: 2rem;
}
.card-img-top {
    height: 220px;
    object-fit: cover;
    border-bottom: 4px solid var(--orange-fun);
}

/* Badges – Softer & Modern */
.badge {
    padding: 0.5em 1em;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}
    /* Update bg-success to match the new green style (Neon Green + Black Text) */
    .bg-success { 
        background-color: #00FF88 !important; 
        color: #000000 !important; /* Changed from #0F172A to #000000 to match */
    }
    
    /* Override Bootstrap's bg-secondary to be Green with BLACK text */
    .bg-secondary, .badge.bg-secondary { 
        background-color: #00FF88 !important; /* Neon Green */
        color: #000000 !important; /* Black Text */
    }

    /* FAB – Even More Playful */
    .fab {
    width: 70px;
    height: 70px;
    background: var(--gradient);
    background-size: 300%;
    animation: wave 8s ease infinite;
    border: 4px solid white;
    box-shadow: 0 15px 40px rgba(255, 159, 28, 0.4);
}
.fab:hover {
    animation: none;
    background: var(--green-happy);
    transform: scale(1.15) rotate(90deg);
}

/* Countdown – Epic */
#countdown {
    font-size: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    text-shadow: none;
    animation: pulse 2s infinite;
}

/* Sleek key/value rows and value pills */
.kv-row {
    gap: .5rem;
}
.kv-label {
    font-size: .9rem;
}
.kv-value {
    font-weight: 600;
}
.value-pill {
    display: inline-block;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: #0f172a0d; /* subtle slate overlay */
    border: 1px solid rgba(15,23,42,0.08);
    color: inherit;
    font-feature-settings: "tnum" on, "lnum" on;
}
.dark-mode .value-pill {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}
.value-pill .js-countdown {
    letter-spacing: .5px;
    font-variant-numeric: tabular-nums;
}

/* Forms – Clean & Spacious */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    padding: 1rem;
    font-size: 1.1rem;
}
.dark-mode .form-control, .dark-mode .form-select {
    background-color: #000000;
    border-color: var(--gray-200);
    color: var(--dark);
}
.form-control:focus {
    border-color: var(--blue-joy);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.2);
}

/* Animations */
/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 13px; /* Adjusted to center vertically in 70px nav if needed, or just stay above it */
    right: 20px;
    z-index: 2000;
    background: var(--light);
    color: var(--dark);
    border: 2px solid var(--deep-blue);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}
.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--deep-blue);
    color: white;
}
.dark-mode .theme-toggle {
    border-color: var(--orange-fun);
}
.dark-mode .theme-toggle:hover {
    background: var(--orange-fun);
    color: var(--light);
}
.theme-toggle svg {
    width: 20px;
    height: 20px;
}
.theme-toggle .sun-icon { display: none; }
.theme-toggle .moon-icon { display: block; }
.dark-mode .theme-toggle .sun-icon { display: block; }
.dark-mode .theme-toggle .moon-icon { display: none; }

@keyframes wave {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .display-5 { font-size: 2.5rem; }
    .fab { width: 60px; height: 60px; font-size: 2rem; }
}

/* --- Badge color classes per BRD mapping --- */
.badge-orange {
    background-color: orange !important;
    color: black !important;
}

.badge-yellow {
    background-color: yellow !important;
    color: black !important;
}

.badge-gray {
    background-color: #9e9e9e !important; /* gray */
    color: black !important;
}

.badge-light-blue {
    background-color: #add8e6 !important; /* light blue */
    color: black !important;
}

.badge-dark-blue {
    background-color: #0d47a1 !important; /* dark blue */
    color: white !important;
}

.badge-neon-green {
    background-color: #39ff14 !important; /* neon green */
    color: black !important;
}

.badge-black {
    background-color: #000 !important;
    color: white !important;
}

.badges-stack .badge { margin-right: .25rem; }
  
.tag-badge {
    background-color: transparent !important;
    color: var(--dark) !important;
    border: 1px solid var(--gray-700) !important;
}

/* --- Rating (wrench infographic) --- */
.rating {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.rating .wrench { 
    display: inline-block; 
    vertical-align: middle;
    transition: opacity .15s ease;
}
.rating .wrench.empty { opacity: .28; }
.rating.rating-sm .wrench { font-size: 1rem; }
.rating.rating-md .wrench { font-size: 1.25rem; }
.rating.rating-lg .wrench { font-size: 1.5rem; }