/* Modern Auth Styling - IHF */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&display=swap");

:root {
  --ihf-blue: #727272;
  /* Brownish Black (New Primary) */
  --ihf-gold: #ebb80f;
  /* Yellow (New Accent) */
  --ihf-orange: #ebb80f;
  /* Yellow (Unified Accent) */
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
}

body {
  /* font-family: "Sora", sans-serif; */
  font-family: 'Playfair Display', serif;
  background-color: var(--bg-light);
  margin: 0;
  background: #fff !important;
  /* Auth pages can override this locally or via specific class */
}

/* Auth Specific Body (Add class 'auth-body' to login/register) */
.auth-body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background Animation */
/* .bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite alternate;
} */

/* .shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 153, 51, 0.3);

    top: -100px;
    left: -100px;
} */
/* 
.shape-2 {
    width: 500px;
    height: 500px;
    background: rgba(0, 51, 102, 0.2);

    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
} */

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  100% {
    transform: translate(50px, 50px) rotate(10deg);
  }
}

/* Auth Card */
.auth-wrapper {
  display: flex;
  width: 900px;
  max-width: 95%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  min-height: 550px;
}

/* Left Side - Brand/Info */
.auth-brand {
  flex: 1;
  background: linear-gradient(135deg, var(--ihf-blue) 0%, #001f3f 100%);
  color: white;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Center content horizontally */
  position: relative;
  overflow: hidden;
  text-align: center;
  /* Center text */
}

.auth-brand::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("https://ihf.org.in/assets/images/pattern.png");
  /* Fallback or Subtle Pattern */
  opacity: 0.1;
  z-index: 0;
}

.brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
  /* Ensure full width for centering */
}

.brand-logo {
  width: 120px;
  margin-bottom: 30px;
  background: white;
  padding: 15px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: inline-block;
  /* Helps with text-align center */
}

.brand-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 40px;
  line-height: 1.6;
  max-width: 300px;
  /* Limit width for better readability */
  margin-left: auto;
  margin-right: auto;
}

/* Right Side - Form */
.auth-form-container {
  flex: 1.2;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  /* Allow scrolling for long forms */
  max-height: 90vh;
  /* Constraint height */
}

/* Custom Scrollbar */
.auth-form-container::-webkit-scrollbar {
  width: 8px;
}

.auth-form-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.auth-form-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.auth-form-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.auth-header {
  margin-bottom: 30px;
  flex-shrink: 0;
}

.auth-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}

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

.form-floating {
  margin-bottom: 20px;
}

.form-control {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 15px;
  height: auto;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #f8fafc;
}

.form-control:focus {
  border-color: var(--ihf-blue);
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
  background-color: white;
}

.btn-primary {
  background: linear-gradient(90deg, var(--ihf-blue) 0%, #4a4a4a 100%);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
  box-shadow: 0 10px 20px rgba(114, 114, 114, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(114, 114, 114, 0.3);
  background: linear-gradient(90deg, #4a4a4a 0%, var(--ihf-blue) 100%);
}

.toggle-password {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94a3b8;
  z-index: 10;
}

.footer-links {
  margin-top: 30px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--ihf-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-links a:hover {
  text-decoration: underline;
  color: var(--ihf-orange);
}

/* =========================================
   DASHBOARD & HEADER STYLES
   ========================================= */

/* Header Background */
.bg-ihf-gradient {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: linear-gradient(90deg, var(--ihf-blue) 0%, #4a4a4a 100%);
  color: white;
}

/* Dashboard Wrapper */
.dashboard-main {
  padding: 2rem 1rem;
  /* Space around the main content (Mobile) */
  min-height: calc(100vh - 70px);
}

@media (min-width: 992px) {
  .dashboard-main {
    padding: 3rem 2rem;
    /* More space on Desktop */
  }

  /* Constrain width to prevent edge-to-edge stretching on large screens */
  .dashboard-main .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .auth-wrapper {
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    min-height: 100vh;
  }

  .auth-brand {
    padding: 40px 20px;
    flex: 0 0 auto;
  }

  .brand-logo {
    width: 80px;
    margin-bottom: 15px;
  }

  .brand-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }

  .brand-subtitle {
    display: none;
  }

  .auth-form-container {
    padding: 40px 30px;
  }
}

/* =========================================
   WIZARD STYLES (Register Page)
   ========================================= */

.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
}

.step {
  width: 40px;
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.step.active {
  background-color: var(--ihf-blue);
}

.auth-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Org Selection Tiles */
.org-tile {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.org-tile i {
  font-size: 2rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.org-tile span {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.org-tile:hover {
  border-color: var(--ihf-blue);
  background-color: #f8fafc;
  transform: translateY(-3px);
}

.org-tile:hover i {
  color: var(--ihf-blue);
}

.org-tile.selected {
  border-color: var(--ihf-blue);
  background-color: rgba(0, 51, 102, 0.05);
  box-shadow: 0 0 0 2px var(--ihf-blue);
  transform: scale(1.02);
}

.org-tile.selected i {
  color: var(--ihf-blue);
}

/* =========================================
   SIDEBAR & LAYOUT (Desktop Mini-Variant)
   ========================================= */

@media (min-width: 992px) {
  /* 1. Sidebar Base State (Mini) */
  .offcanvas-lg {
    visibility: visible !important;
    transform: none !important;
    position: fixed;
    top: 70px;
    /* Below Navbar */
    left: 0;
    bottom: 0;
    width: 80px;
    /* Icon only width */
    z-index: 1040;
    background: white;
    border-right: 1px solid #e2e8f0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.25s;
    /* Delay 0.25s */
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.02);
  }

  /* 2. Hover Expansion */
  .offcanvas-lg:hover {
    width: 280px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
  }

  /* Force Flex Row on Desktop/All */
  .offcanvas-lg .list-group-item {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
  }

  /* 3. Items & Icons */
  .offcanvas-lg .list-group-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 16px 20px !important;
    /* Center icons */
    height: 56px;
    color: var(--text-muted);
    transition: all 0.2s;
  }

  .offcanvas-lg .list-group-item i {
    font-size: 1.25rem;
    min-width: 30px;
    /* Fixed width for icon alignment */
    text-align: center;
  }

  /* 4. Text Labels (Hidden by default) */
  .nav-label {
    opacity: 0;
    /* margin-left: 15px; Removed in favor of gap-2 utility */
    transform: translateX(-10px);
    transition: all 0.2s ease 0.25s;
    /* Sync with width delay */
  }

  .offcanvas-lg:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
  }

  /* Section Titles (Hidden in Mini) */
  .section-title,
  .offcanvas-header {
    opacity: 0;
    height: 0;
    margin: 0 !important;
    overflow: hidden;
    transition: opacity 0.2s ease 0.25s;
  }

  .offcanvas-lg:hover .section-title {
    opacity: 1;
    height: auto;
    margin: 1rem 0 0.5rem 0 !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .offcanvas-lg:hover .offcanvas-header {
    opacity: 1;
    height: auto;
    padding: 1rem 1.5rem;
  }

  /* 5. Main Content Adjustment */
  .dashboard-main {
    margin-left: 80px;
    /* Matches Sidebar Base Width */
    padding: 2rem;
    transition: margin-left 0.3s;
  }

  /* Active State */
  .active-nav-item {
    color: var(--ihf-blue) !important;
    background-color: rgba(114, 114, 114, 0.1) !important;
    /* Subtle Gray */
    border-right: 3px solid var(--ihf-blue) !important;
  }

  .active-nav-item i {
    color: var(--ihf-blue);
  }

  /* Hide submenus in mini-mode to prevent icons from lingering */
  .offcanvas-lg:not(:hover) .collapse,
  .offcanvas-lg:not(:hover) .collapsing {
    display: none !important;
  }
}

/* Custom Scrollbar for Sidebar */
.offcanvas-lg::-webkit-scrollbar {
  width: 5px;
}

.offcanvas-lg::-webkit-scrollbar-track {
  background: transparent;
}

.offcanvas-lg::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
