/**
 * Ghar Aapka - Building Material Marketplace
 * Brand Theme & Design System Tokens
 * Matched with Official Logo & Product Design Standards
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Brand Core Colors (From Ghar Aapka Logo) */
  --brand-navy: #00377a;          /* Logo Deep Royal Blue */
  --brand-navy-dark: #071933;     /* Sidebar & Header Midnight Navy */
  --brand-navy-light: #0b4998;    /* Interactive Blue */
  --brand-orange: #ff5e00;        /* Logo Vibrant Construction Orange */
  --brand-orange-hover: #e65200;  /* Button Hover State */
  --brand-orange-light: #fff2ea;  /* Orange Tint Surface */
  --brand-orange-border: #ffd5be; /* Orange Accent Borders */
  --brand-yellow: #ffa200;        /* Golden Saffron Accent */

  /* Semantic UI Colors */
  --color-primary: var(--brand-navy-dark);
  --color-brand: var(--brand-orange);
  --color-brand-hover: var(--brand-orange-hover);
  --color-brand-light: var(--brand-orange-light);
  --color-accent-blue: #0056b3;
  --color-accent-blue-hover: #004085;
  --color-accent-blue-subtle: #eef6ff;

  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;

  /* Surfaces & Backgrounds */
  --bg-body: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f8fafc;
  --bg-sidebar: #081a36;
  --bg-topbar: #0d254c;
  --border-color: #e2e8f0;
  --border-color-focus: #cbd5e1;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(11, 31, 61, 0.08), 0 1px 2px -1px rgba(11, 31, 61, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(11, 31, 61, 0.1), 0 2px 4px -2px rgba(11, 31, 61, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(11, 31, 61, 0.12), 0 4px 6px -4px rgba(11, 31, 61, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(11, 31, 61, 0.14), 0 8px 10px -6px rgba(11, 31, 61, 0.08);

  /* Radius - subtle, crisp rounded corners instead of over-rounded pills */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-brand-hover);
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ==========================================================================
   Page Buffering & Button Loading States (Ghar-Aapka Design System)
   ========================================================================== */

/* Top Shimmering Buffering Bar */
.global-page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 99999999;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

.global-page-loader.is-active {
  display: block;
}

.global-page-loader .loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff5e00 0%, #ffa200 35%, #00d2ff 65%, #ff5e00 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(255, 94, 0, 0.95), 0 0 8px rgba(255, 162, 0, 0.8);
  transition: width 0.22s cubic-bezier(0.1, 0.5, 0.1, 1), opacity 0.25s ease;
  animation: pageLoaderShimmer 1.2s infinite linear;
}

@keyframes pageLoaderShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Sidebar Navigation Items Buffering States */
.nav-item.nav-buffering {
  position: relative !important;
  color: #ffffff !important;
  background: linear-gradient(90deg, rgba(255, 94, 0, 0.35) 0%, rgba(255, 115, 0, 0.2) 100%) !important;
  box-shadow: 0 0 14px rgba(255, 94, 0, 0.4) !important;
  pointer-events: none !important;
  animation: navPulse 1s infinite ease-in-out;
}

.nav-item.nav-buffering::after {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ff5e00;
  border-radius: 50%;
  animation: btnSpinnerRotate 0.65s linear infinite;
  flex-shrink: 0;
}

.nav-subitem.nav-buffering {
  position: relative !important;
  color: #ffffff !important;
  background: rgba(255, 94, 0, 0.25) !important;
  border: 1px solid rgba(255, 94, 0, 0.5) !important;
  pointer-events: none !important;
  animation: navPulse 1s infinite ease-in-out;
}

.nav-subitem.nav-buffering .subitem-dot {
  width: 10px !important;
  height: 10px !important;
  border: 2px solid rgba(255, 255, 255, 0.25) !important;
  border-top-color: #ff5e00 !important;
  border-radius: 50% !important;
  background: transparent !important;
  animation: btnSpinnerRotate 0.65s linear infinite !important;
  box-shadow: 0 0 8px rgba(255, 94, 0, 0.8) !important;
}

@keyframes navPulse {
  0% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.82;
  }
}

/* Button Loading & Spinner States */
.btn.is-loading,
button.is-loading,
a.is-loading,
.btn-loading {
  position: relative !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  opacity: 0.88 !important;
  transition: opacity 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.2) !important;
}

/* Spinner Element inside Button */
.btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpinnerRotate 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Secondary / Light / Outline button contrast */
.btn-secondary .btn-spinner,
.btn-outline .btn-spinner,
.btn-light .btn-spinner,
button[style*="background: #ffffff"] .btn-spinner,
button[style*="background:#ffffff"] .btn-spinner,
button[style*="background: white"] .btn-spinner {
  border-color: rgba(0, 55, 122, 0.25);
  border-top-color: var(--brand-navy, #00377a);
}

.btn-loading-text {
  display: inline-block;
  vertical-align: middle;
}

@keyframes btnSpinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

