/**
 * Sanctuary Glass 2.0 - Global Design System
 * Unified CSS for HomeProHub
 */

/* ========================================
   GLOBAL RESETS & BASE STYLES
   ======================================== */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ========================================
   CANVAS RULES
   ======================================== */

/* Public Pages: Gradient Canvas */
body.zone-a,
body.zone-b,
body.public-page {
  background: linear-gradient(to bottom, rgba(239, 246, 255, 0.5) 0%, rgb(248, 250, 252) 100%);
}

/* App/Dashboards: Solid Canvas */
body.zone-c,
body.zone-d,
body.app-page {
  background: rgb(248, 250, 252); /* bg-slate-50 */
}

/* ========================================
   GLASS CARD SYSTEM
   ======================================== */

.glass-card {
  background: white;
  border-radius: 24px; /* rounded-3xl */
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); /* shadow-sm */
  border: 1px solid rgb(241, 245, 249); /* border-slate-100 */
  overflow: hidden;
}

.glass-card-hover {
  transition: all 0.3s ease;
}

.glass-card-hover:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ========================================
   FLOATER INPUTS
   ======================================== */

.floater-input {
  border-radius: 9999px; /* rounded-full */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-xl */
  border: 1px solid rgba(15, 23, 42, 0.05); /* ring-1 ring-slate-900/5 */
  padding: 12px 24px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.floater-input:focus {
  outline: none;
  ring: 2px solid rgb(59, 130, 246); /* ring-blue-500 */
  box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
}

/* ========================================
   GLOW BUTTONS
   ======================================== */

.glow-button {
  background: rgb(37, 99, 235); /* bg-blue-600 */
  color: white;
  font-weight: 700;
  border-radius: 12px; /* rounded-xl */
  padding: 12px 32px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3), 0 4px 6px -4px rgba(37, 99, 235, 0.3); /* shadow-lg shadow-blue-600/20 */
  transition: all 0.2s ease;
}

.glow-button:hover {
  transform: scale(1.05); /* hover:scale-105 */
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4), 0 8px 10px -6px rgba(37, 99, 235, 0.4);
}

.glow-button:active {
  transform: scale(0.98);
}

.glow-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Secondary Button Variant */
.glow-button-secondary {
  background: rgb(100, 116, 139); /* bg-slate-500 */
  box-shadow: 0 10px 15px -3px rgba(100, 116, 139, 0.3), 0 4px 6px -4px rgba(100, 116, 139, 0.3);
}

.glow-button-secondary:hover {
  background: rgb(71, 85, 105); /* bg-slate-600 */
}

/* Success Button Variant */
.glow-button-success {
  background: rgb(16, 185, 129); /* bg-emerald-500 */
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3), 0 4px 6px -4px rgba(16, 185, 129, 0.3);
}

.glow-button-success:hover {
  background: rgb(5, 150, 105); /* bg-emerald-600 */
}

/* ========================================
   TYPOGRAPHY SYSTEM (Inter Font)
   ======================================== */

/* Logo/Brand */
.brand-logo {
  font-size: 20px; /* text-xl */
  font-weight: 800; /* font-extrabold */
  color: rgb(15, 23, 42); /* text-slate-900 */
  letter-spacing: -0.03em; /* tracking-tight */
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.heading {
  color: rgb(15, 23, 42); /* text-slate-900 */
  font-weight: 800; /* font-extrabold */
  letter-spacing: -0.02em;
}

h1 { font-size: 36px; line-height: 1.1; }
h2 { font-size: 30px; line-height: 1.2; }
h3 { font-size: 24px; line-height: 1.3; }
h4 { font-size: 20px; line-height: 1.4; }
h5 { font-size: 18px; line-height: 1.4; }
h6 { font-size: 16px; line-height: 1.4; }

/* Body Text */
p, .body-text {
  color: rgb(100, 116, 139); /* text-slate-500 */
  font-weight: 500; /* font-medium */
  line-height: 1.6;
}

/* Strong emphasis */
strong {
  color: rgb(15, 23, 42); /* text-slate-900 */
  font-weight: 700;
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   ======================================== */

.mobile-app-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgb(226, 232, 240); /* border-slate-200 */
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}

.mobile-app-dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  padding: 8px 0;
  color: rgb(148, 163, 184); /* text-slate-400 */
  text-decoration: none;
  transition: color 0.2s ease;
}

.mobile-app-dock-item.active {
  color: rgb(37, 99, 235); /* text-blue-600 */
}

.mobile-app-dock-item i {
  font-size: 20px;
}

.mobile-app-dock-item span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========================================
   DESKTOP HEADER
   ======================================== */

.desktop-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgb(226, 232, 240); /* border-slate-200 */
  position: sticky;
  top: 0;
  z-index: 40;
}

/* ========================================
   PROFILE DROPDOWN
   ======================================== */

.profile-dropdown {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-xl */
  border: 1px solid rgb(241, 245, 249); /* border-slate-100 */
  overflow: hidden;
}

.profile-dropdown-item {
  padding: 12px 16px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.profile-dropdown-item:hover {
  background: rgb(248, 250, 252); /* bg-slate-50 */
}

.profile-dropdown-item.danger {
  color: rgb(220, 38, 38); /* text-red-600 */
}

.profile-dropdown-item.danger:hover {
  background: rgb(254, 242, 242); /* bg-red-50 */
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  h4 { font-size: 18px; }

  .container,
  .container-wide,
  .container-narrow {
    padding: 0 16px;
  }

  /* Add bottom padding for mobile nav */
  body {
    padding-bottom: 80px;
  }
}

@media (min-width: 768px) {
  /* Hide mobile nav on desktop */
  .mobile-app-dock {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* ========================================
   ANIMATION UTILITIES
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.4s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* ========================================
   LOADING STATES
   ======================================== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 3px solid rgb(226, 232, 240); /* border-slate-200 */
  border-top-color: rgb(37, 99, 235); /* border-blue-600 */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   NOTIFICATION SYSTEM
   ======================================== */

/* Notification Badge */
.notification-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Toast Notification Animations */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-out-right {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

/* Notification Panel Animations */
#notificationPanel {
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Notification Panel */
#mobileNotificationPanel {
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobileNotificationPanel:not(.hidden) {
  transform: translateY(0);
}

/* Notification Item Hover Effects */
.notification-item {
  position: relative;
  transition: all 0.2s ease;
}

.notification-item:hover {
  background-color: rgb(248, 250, 252) !important; /* bg-slate-50 */
}

.notification-item:active {
  transform: scale(0.98);
}

/* Unread Notification Highlight */
.notification-item[data-read="false"] {
  position: relative;
}

.notification-item[data-read="false"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgb(59, 130, 246); /* bg-blue-500 */
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .mobile-app-dock,
  .desktop-header,
  .profile-dropdown,
  #notificationPanel,
  #mobileNotificationPanel,
  #notificationToast {
    display: none !important;
  }

  body {
    padding-bottom: 0 !important;
  }
}
