/* ============================================
   PORTAL V2 DESIGN SYSTEM
   Unified styling for Customer & Admin Portals
   Based on customer_profile_v2.html & settings.html
   ============================================ */

/* ============================================
   BACKGROUND & LAYOUT
   ============================================ */
body.portal-v2 {
  background-color: #eae7d8;
}

/* ============================================
   BRAND COLORS - OVERRIDE BOOTSTRAP DEFAULTS
   ============================================ */
.portal-v2 .btn-primary {
  background-color: #448d8a;
  border: none;
}

.portal-v2 .btn-primary:hover {
  background-color: #316563;
}

/* ============================================
   GRADIENT HEADER
   Large hero section at top of page
   ============================================ */
.portal-header {
  background:
    radial-gradient(circle at top right, rgba(240, 211, 122, 0.22), transparent 28%),
    linear-gradient(135deg, #224947 0%, #316563 48%, #448d8a 100%);
  color: white;
  padding: 2.25rem;
  margin-bottom: 2rem;
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(20, 42, 41, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-header h1,
.portal-header h2 {
  margin-bottom: 0.5rem;
  color: white;
}

.portal-header p {
  opacity: 0.9;
  margin-bottom: 0;
}

/* ============================================
   LOYALTY PAGES: high-specificity page-header overrides
   Ensures consistent gradient headers across loyalty admin pages
   ============================================ */
.content .container-fluid.loyalty-dashboard .page-header,
.content .container-fluid.loyalty-customers .page-header,
.content .container-fluid.tiers-page .page-header,
.content .container-fluid.customer-detail .page-header,
.content .container-fluid .loyalty-page-header {
  background: linear-gradient(135deg, #316563 0%, #9dbb9f 100%);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
}

.content .container-fluid.loyalty-dashboard .page-header h1,
.content .container-fluid.loyalty-customers .page-header h1,
.content .container-fluid.tiers-page .page-header h1,
.content .container-fluid.customer-detail .page-header h1,
.content .container-fluid .loyalty-page-header h1 {
  color: white;
  font-size: 2rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Profile Avatar (for customer profile header) */
.portal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Quick Stats in Header */
.portal-header .stat-item {
  text-align: center;
}

.portal-header .stat-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.portal-header .stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* ============================================
   TAB NAVIGATION
   Pill-style tabs with gradient active state
   ============================================ */
.portal-tabs {
  background: white;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Remove Bootstrap's default borders for nav-tabs */
.portal-tabs.nav-tabs {
  border-bottom: 0;
}

.portal-tabs.nav-tabs .nav-link {
  border: 0;
}

.portal-tabs.nav-tabs .nav-link.active {
  border: 0;
}

.portal-tabs .nav-link {
  color: #666;
  border: none;
  padding: 0.75rem 1.5rem;
  margin: 0 0.25rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.portal-tabs .nav-link:hover {
  background: #f8f9fa;
  color: #316563;
}

.portal-tabs .nav-link.active {
  background: linear-gradient(135deg, #316563 0%, #448d8a 100%);
  color: white;
}

.portal-tabs .nav-link i {
  margin-right: 0.5rem;
}

/* ============================================
   TAB CONTENT WRAPPER
   Main white card containing tab content
   ============================================ */
.tab-content-wrapper {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-height: 500px;
}

/* ============================================
   INFO CARDS
   Sectioned cards within tab content
   ============================================ */
.info-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.info-card-header {
  font-weight: 600;
  font-size: 1.1rem;
  color: #316563;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card-header i {
  color: #448d8a;
}

/* ============================================
   STATUS BADGES
   Rounded pill badges for statuses
   ============================================ */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-completed {
  background: #d1ecf1;
  color: #0c5460;
}

/* ============================================
   CARD OVERRIDES
   Consistent card styling across portal
   ============================================ */
.portal-v2 .card {
  border-radius: 18px;
  border: 1px solid rgba(33, 73, 71, 0.08);
  box-shadow: 0 18px 38px rgba(20, 35, 35, 0.08);
  overflow: hidden;
}

.portal-v2 .card-title {
  color: #316563;
  font-weight: 600;
  font-size: 1.1rem;
}

.portal-v2 .card-header {
  border-bottom: 0;
}

/* ============================================
   MESSAGE BUBBLES
   For communication/messaging features
   ============================================ */
.message-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.message-bubble {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem;
  flex-grow: 1;
}

.message-bubble.from-admin {
  background: linear-gradient(135deg, #e8f4f3 0%, #f0f8f7 100%);
  border-left: 3px solid #316563;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.message-author {
  font-weight: 600;
  color: #316563;
}

.message-time {
  font-size: 0.85rem;
  color: #999;
}

/* ============================================
   MODAL SCROLLING FIX
   Ensures modals scroll properly
   ============================================ */
.modal-dialog.modal-dialog-scrollable {
  height: auto !important;
  max-height: calc(100vh - 3.5rem) !important;
}

.modal-dialog.modal-dialog-scrollable .modal-content {
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.modal-dialog.modal-dialog-scrollable .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
}

.modal-dialog.modal-dialog-scrollable .modal-header,
.modal-dialog.modal-dialog-scrollable .modal-footer {
  flex-shrink: 0 !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary-dark {
  color: #316563 !important;
}

.text-primary-light {
  color: #448d8a !important;
}

.bg-primary-gradient {
  background: linear-gradient(135deg, #316563 0%, #448d8a 100%) !important;
}

.bg-primary-50 {
  background: #e8f4f3 !important;
}

.shadow-soft {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

.shadow-medium {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.rounded-lg {
  border-radius: 12px !important;
}

.rounded-xl {
  border-radius: 16px !important;
}
