/* 
 * HouseBlue Responsive Framework
 * Mobile-First Responsive Design System
 */

/* =============================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================= */
:root {
  /* Colors */
  --hb-primary: #0d6efd;
  --hb-primary-dark: #0056b3;
  --hb-primary-light: #3d8bfd;
  --hb-secondary: #6c757d;
  --hb-success: #198754;
  --hb-warning: #ffc107;
  --hb-danger: #dc3545;
  --hb-info: #0dcaf0;
  --hb-light: #f8f9fa;
  --hb-dark: #212529;
  --hb-muted: #6c757d;
  --hb-white: #ffffff;
  
  /* Grays */
  --hb-gray-50: #f8f9fa;
  --hb-gray-100: #e9ecef;
  --hb-gray-200: #dee2e6;
  --hb-gray-300: #ced4da;
  --hb-gray-400: #adb5bd;
  --hb-gray-500: #6c757d;
  --hb-gray-600: #495057;
  --hb-gray-700: #343a40;
  --hb-gray-800: #212529;
  --hb-gray-900: #000000;
  
  /* Spacing Scale (Mobile-first) */
  --hb-space-1: 0.25rem;  /* 4px */
  --hb-space-2: 0.5rem;   /* 8px */
  --hb-space-3: 0.75rem;  /* 12px */
  --hb-space-4: 1rem;     /* 16px */
  --hb-space-5: 1.25rem;  /* 20px */
  --hb-space-6: 1.5rem;   /* 24px */
  --hb-space-8: 2rem;     /* 32px */
  --hb-space-10: 2.5rem;  /* 40px */
  --hb-space-12: 3rem;    /* 48px */
  --hb-space-16: 4rem;    /* 64px */
  --hb-space-20: 5rem;    /* 80px */
  
  /* Typography Scale (Mobile-first) */
  --hb-text-xs: 0.75rem;    /* 12px */
  --hb-text-sm: 0.875rem;   /* 14px */
  --hb-text-base: 1rem;     /* 16px */
  --hb-text-lg: 1.125rem;   /* 18px */
  --hb-text-xl: 1.25rem;    /* 20px */
  --hb-text-2xl: 1.5rem;    /* 24px */
  --hb-text-3xl: 1.875rem;  /* 30px */
  --hb-text-4xl: 2.25rem;   /* 36px */
  --hb-text-5xl: 3rem;      /* 48px */
  
  /* Border Radius */
  --hb-radius-sm: 0.375rem;  /* 6px */
  --hb-radius: 0.5rem;       /* 8px */
  --hb-radius-md: 0.75rem;   /* 12px */
  --hb-radius-lg: 1rem;      /* 16px */
  --hb-radius-xl: 1.5rem;    /* 24px */
  --hb-radius-full: 9999px;
  
  /* Shadows */
  --hb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --hb-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --hb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --hb-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Breakpoints */
  --hb-breakpoint-sm: 576px;
  --hb-breakpoint-md: 768px;
  --hb-breakpoint-lg: 992px;
  --hb-breakpoint-xl: 1200px;
  --hb-breakpoint-xxl: 1400px;
  
  /* Z-Index Scale */
  --hb-z-dropdown: 1000;
  --hb-z-modal: 1050;
  --hb-z-popover: 1060;
  --hb-z-tooltip: 1070;
  --hb-z-navbar: 1080;
  
  /* Transitions */
  --hb-transition: all 0.2s ease-in-out;
  --hb-transition-fast: all 0.15s ease-in-out;
  --hb-transition-slow: all 0.3s ease-in-out;
}

/* =============================================================================
   RESPONSIVE UTILITIES
   ============================================================================= */

/* Container System */
.hb-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--hb-space-4);
}

@media (min-width: 576px) {
  .hb-container { max-width: 540px; }
}

@media (min-width: 768px) {
  .hb-container { 
    max-width: 720px;
    padding: 0 var(--hb-space-6);
  }
}

@media (min-width: 992px) {
  .hb-container { max-width: 960px; }
}

@media (min-width: 1200px) {
  .hb-container { max-width: 1140px; }
}

@media (min-width: 1400px) {
  .hb-container { max-width: 1320px; }
}

/* =============================================================================
   MOBILE-FIRST NAVIGATION SYSTEM
   ============================================================================= */

/* Base Navigation Styles (Mobile First) */
.hb-navbar {
  position: sticky;
  top: 0;
  z-index: var(--hb-z-navbar);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hb-gray-200);
  box-shadow: var(--hb-shadow-sm);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hb-navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--hb-space-4);
  min-height: 4rem;
}

/* Brand Logo */
.hb-navbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--hb-text-xl);
  color: var(--hb-primary);
  transition: var(--hb-transition);
}

.hb-navbar-brand:hover {
  transform: translateY(-1px);
  color: var(--hb-primary-dark);
}

.hb-navbar-brand-icon {
  font-size: var(--hb-text-3xl);
  margin-right: var(--hb-space-2);
  background: linear-gradient(135deg, var(--hb-primary) 0%, var(--hb-primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-navbar-brand-text {
  background: linear-gradient(135deg, var(--hb-primary) 0%, var(--hb-primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Menu Toggle */
.hb-navbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--hb-primary);
  border-radius: var(--hb-radius);
  background: transparent;
  cursor: pointer;
  transition: var(--hb-transition);
  z-index: calc(var(--hb-z-navbar) + 1);
}

.hb-navbar-toggle:hover {
  background: var(--hb-primary);
  transform: scale(1.05);
}

.hb-navbar-toggle:hover .hb-navbar-toggle-icon {
  color: var(--hb-white);
}

.hb-navbar-toggle-icon {
  font-size: var(--hb-text-lg);
  color: var(--hb-primary);
  transition: var(--hb-transition);
}

/* Mobile Navigation Menu */
.hb-navbar-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--hb-white);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: var(--hb-z-navbar);
  overflow-y: auto;
}

.hb-navbar-menu.open {
  transform: translateX(0);
}

.hb-navbar-menu-content {
  padding: var(--hb-space-20) var(--hb-space-4) var(--hb-space-4);
}

.hb-navbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hb-navbar-nav-item {
  margin-bottom: var(--hb-space-2);
}

.hb-navbar-nav-link {
  display: flex;
  align-items: center;
  padding: var(--hb-space-4);
  text-decoration: none;
  color: var(--hb-dark);
  font-weight: 600;
  font-size: var(--hb-text-lg);
  border-radius: var(--hb-radius-md);
  transition: var(--hb-transition);
  border: 1px solid transparent;
}

.hb-navbar-nav-link:hover,
.hb-navbar-nav-link.active {
  background: var(--hb-gray-50);
  color: var(--hb-primary);
  border-color: var(--hb-gray-200);
  transform: translateX(var(--hb-space-2));
}

.hb-navbar-nav-link i {
  margin-right: var(--hb-space-3);
  font-size: var(--hb-text-xl);
  width: 1.5rem;
  text-align: center;
}

/* Badge for notifications */
.hb-navbar-badge {
  margin-left: auto;
  background: var(--hb-danger);
  color: var(--hb-white);
  font-size: var(--hb-text-xs);
  font-weight: 600;
  padding: var(--hb-space-1) var(--hb-space-2);
  border-radius: var(--hb-radius-full);
  min-width: 1.25rem;
  text-align: center;
}

/* Action Buttons in Mobile Menu */
.hb-navbar-actions {
  margin-top: var(--hb-space-8);
  padding-top: var(--hb-space-6);
  border-top: 1px solid var(--hb-gray-200);
}

.hb-navbar-btn {
  display: block;
  width: 100%;
  padding: var(--hb-space-4);
  margin-bottom: var(--hb-space-3);
  border: 2px solid var(--hb-primary);
  border-radius: var(--hb-radius-md);
  background: transparent;
  color: var(--hb-primary);
  font-weight: 600;
  font-size: var(--hb-text-base);
  text-decoration: none;
  text-align: center;
  transition: var(--hb-transition);
  cursor: pointer;
}

.hb-navbar-btn:hover {
  background: var(--hb-primary);
  color: var(--hb-white);
  transform: translateY(-1px);
  box-shadow: var(--hb-shadow-md);
}

.hb-navbar-btn.primary {
  background: var(--hb-primary);
  color: var(--hb-white);
}

.hb-navbar-btn.primary:hover {
  background: var(--hb-primary-dark);
  border-color: var(--hb-primary-dark);
}

.hb-navbar-btn.danger {
  border-color: var(--hb-danger);
  color: var(--hb-danger);
}

.hb-navbar-btn.danger:hover {
  background: var(--hb-danger);
  color: var(--hb-white);
}

/* Desktop Navigation Styles */
@media (min-width: 768px) {
  .hb-navbar-toggle {
    display: none;
  }
  
  .hb-navbar-menu {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    transform: none;
    overflow: visible;
  }
  
  .hb-navbar-menu-content {
    padding: 0;
  }
  
  .hb-navbar-nav {
    display: flex;
    align-items: center;
  }
  
  .hb-navbar-nav-item {
    margin: 0 var(--hb-space-2);
  }
  
  .hb-navbar-nav-link {
    padding: var(--hb-space-3) var(--hb-space-4);
    font-size: var(--hb-text-base);
    position: relative;
    overflow: hidden;
  }
  
  .hb-navbar-nav-link:hover {
    transform: translateY(-2px);
    background: rgba(13, 110, 253, 0.1);
  }
  
  .hb-navbar-nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--hb-primary) 0%, var(--hb-info) 100%);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: var(--hb-radius-sm);
  }
  
  .hb-navbar-nav-link:hover::before,
  .hb-navbar-nav-link.active::before {
    width: 80%;
  }
  
  .hb-navbar-actions {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: none;
  }
  
  .hb-navbar-btn {
    display: inline-block;
    width: auto;
    margin: 0 var(--hb-space-2);
    padding: var(--hb-space-3) var(--hb-space-5);
    font-size: var(--hb-text-sm);
  }
}

/* Large Desktop Optimization */
@media (min-width: 1200px) {
  .hb-navbar-container {
    padding: var(--hb-space-6) var(--hb-space-8);
  }
  
  .hb-navbar-brand {
    font-size: var(--hb-text-2xl);
  }
  
  .hb-navbar-brand-icon {
    font-size: var(--hb-text-4xl);
  }
}

/* =============================================================================
   DASHBOARD SIDEBAR SYSTEM
   ============================================================================= */

.hb-dashboard {
  display: flex;
  min-height: 100vh;
}

.hb-dashboard-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--hb-white);
  border-right: 1px solid var(--hb-gray-200);
  box-shadow: var(--hb-shadow);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: calc(var(--hb-z-navbar) - 1);
  overflow-y: auto;
}

.hb-dashboard-sidebar.open {
  transform: translateX(0);
}

.hb-dashboard-content {
  flex: 1;
  margin-left: 0;
  transition: margin-left 0.3s ease-in-out;
}

/* Desktop Dashboard Layout */
@media (min-width: 992px) {
  .hb-dashboard-sidebar {
    position: static;
    transform: none;
    z-index: auto;
  }
  
  .hb-dashboard-content {
    margin-left: 280px;
  }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

/* Hide on mobile */
@media (max-width: 767.98px) {
  .hb-d-none-mobile {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 768px) {
  .hb-d-none-desktop {
    display: none !important;
  }
}

/* Touch-friendly tap targets */
.hb-touch-target {
  min-height: 44px;
  min-width: 44px;
}

/* Smooth scrolling */
.hb-smooth-scroll {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
.hb-focus-visible:focus-visible {
  outline: 2px solid var(--hb-primary);
  outline-offset: 2px;
}