﻿/* ==========================================================================
   1. GLOBAL & THEMING VARS
   ========================================================================== */
:root {
  --glass-bg-light: rgba(255, 255, 255, 0.75);
  --glass-bg-dark: rgba(20, 20, 20, 0.82);
  --glass-border-light: rgba(255, 255, 255, 0.3);
  --glass-border-dark: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(14px);
  --transition-smooth: all 0.3s ease-in-out;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* Prevent body jump when Offcanvas or Modal opens */
body.offcanvas-open,
body[style*="overflow: hidden"] {
  padding-right: 0px !important;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Keep the fixed header from shifting */
.fixed-top,
.fixed-bottom,
#mainHeader {
  padding-right: 0px !important;
}


/* Base utility for smooth transitions */
.transition-base {
  transition: var(--transition-smooth);
}

/* ==========================================================================
   2. GLASSMORPHISM (HEADER & OFFCANVAS)
   ========================================================================== */

/* Header background dynamic transition */
#mainHeader {
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

/* Apply Glass Effect when Header or Offcanvas is active */
.glass-panel,
.offcanvas {
  background-color: var(--glass-bg-light) !important;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border-light);
}

/* Dark Mode Glass Overrides */
[data-bs-theme="dark"] .glass-panel,
[data-bs-theme="dark"] .offcanvas {
  background-color: var(--glass-bg-dark) !important;
  border-left: 1px solid var(--glass-border-dark);
}

/* Offcanvas Menu Polish */
.offcanvas-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-body .nav-link {
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

  .offcanvas-body .nav-link:hover,
  .offcanvas-body .nav-link.active {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--bs-primary) !important;
  }

[data-bs-theme="dark"] .offcanvas-body .nav-link:hover,
[data-bs-theme="dark"] .offcanvas-body .nav-link.active {
  background-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   3. HERO PARALLAX SECTION
   ========================================================================== */
.parallax-bg {
  background-attachment: fixed !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Turn off fixed background attachment on mobile devices to prevent iOS rendering glitches */
@media (max-width: 991.98px) {
  .parallax-bg {
    background-attachment: scroll !important;
  }
}

.tracking-wide {
  letter-spacing: 2px;
}

/* ==========================================================================
   4. THEME TOGGLE SWITCH STYLING
   ========================================================================== */
.theme-switch .form-check-input {
  width: 3em;
  height: 1.6em;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  transition: background-position 0.15s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}

  .theme-switch .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
  }

/* ==========================================================================
   5. TABLES & CONTACT FORM
   ========================================================================== */
.table-responsive {
  border-radius: inherit;
}

.fs-7 {
  font-size: 0.85rem;
}

.hover-opacity-100:hover {
  opacity: 1 !important;
  transform: translateY(-2px);
}

/* Modern focus glow for form controls */
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Always keep toggler visible */
.navbar-toggler {
  display: inline-block !important;
}


/* Custom Floating Card Offcanvas */
.floating-offcanvas {
  top: 16px !important;
  right: 16px !important;
  bottom: 16px !important;
  height: calc(100vh - 32px) !important;
  width: 320px !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* --- LIGHT MODE STYLES --- */
[data-bs-theme="light"] .floating-offcanvas {
  background-color: rgba(255, 255, 255, 0.92) !important;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #1a1a1a !important;
}

  [data-bs-theme="light"] .floating-offcanvas .offcanvas-title {
    color: #1a1a1a !important;
  }

  [data-bs-theme="light"] .floating-offcanvas .btn-close {
    background-color: rgba(0, 0, 0, 0.08);
    opacity: 0.8;
    border-radius: 8px;
    padding: 0.6rem;
  }

  [data-bs-theme="light"] .floating-offcanvas .nav-link {
    color: #4a5568 !important; /* Dark charcoal text for high contrast */
  }

    [data-bs-theme="light"] .floating-offcanvas .nav-link:hover,
    [data-bs-theme="light"] .floating-offcanvas .nav-link.active {
      color: #000000 !important;
      background-color: rgba(0, 0, 0, 0.08) !important;
    }

/* --- DARK MODE STYLES (DEFAULT) --- */
[data-bs-theme="dark"] .floating-offcanvas {
  background-color: #0d0e12 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

  [data-bs-theme="dark"] .floating-offcanvas .offcanvas-title {
    color: #ffffff !important;
  }

  [data-bs-theme="dark"] .floating-offcanvas .btn-close {
    background-color: rgba(255, 255, 255, 0.15);
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
    border-radius: 8px;
    padding: 0.6rem;
  }

  [data-bs-theme="dark"] .floating-offcanvas .nav-link {
    color: #b0b5c0 !important;
  }

    [data-bs-theme="dark"] .floating-offcanvas .nav-link:hover,
    [data-bs-theme="dark"] .floating-offcanvas .nav-link.active {
      color: #ffffff !important;
      background-color: rgba(255, 255, 255, 0.1) !important;
    }

/* ==========================================================================
   CUSTOM WIDE THEME TOGGLE SWITCH WITH EMBEDDED KNOB ICONS
   ========================================================================== */
.theme-toggle-wrapper {
  display: inline-block;
  position: relative;
  user-select: none;
}

/* Hide standard native checkbox */
.theme-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Wide Track Styling */
.theme-toggle-track {
  display: flex;
  align-items: center;
  position: relative;
  width: 68px; /* Extra wide track */
  height: 32px;
  background-color: #2b3036; /* Dark slate track for clear contrast */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

  /* Sliding Knob */
  .theme-toggle-track::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 4px;
    width: 24px;
    height: 24px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    z-index: 1;
  }

  /* Icon Positioning inside Knob */
  .theme-toggle-track .bi {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.3s ease;
  }

  /* Sun Icon (Light Mode - Knob Left) */
  .theme-toggle-track .icon-sun {
    left: 8px;
    color: #f59e0b; /* Vibrant amber/yellow */
    opacity: 1;
  }

  /* Moon Icon (Dark Mode - Knob Right) */
  .theme-toggle-track .icon-moon {
    left: 42px;
    color: #38bdf8; /* Lighter bright cyan/sky blue moon */
    opacity: 0.5;
  }

/* --- CHECKED STATE (DARK MODE ACTIVE) --- */
/* Move Knob to the Right */
.theme-toggle-input:checked + .theme-toggle-track::before {
  transform: translateX(36px);
  background-color: #1e293b; /* Dark knob in dark mode */
}

/* Fade Sun, Highlight Lighter Blue Moon */
.theme-toggle-input:checked + .theme-toggle-track .icon-sun {
  opacity: 0.4;
}

.theme-toggle-input:checked + .theme-toggle-track .icon-moon {
  opacity: 1;
}

/* Hover Effect */
.theme-toggle-track:hover {
  border-color: rgba(255, 255, 255, 0.4);
}