/**
 * Paikmal Status Module - Enhanced UI/UX Styles v2.0
 * Modern, polished design with improved visual hierarchy and spacing
 */

/* ===== CSS Custom Properties ===== */
:root {
  --status-primary: #0f766e;
  --status-primary-light: #14b8a6;
  --status-primary-dark: #0d5d56;
  --status-gradient: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  --status-shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  --status-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  --status-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  --status-radius: 16px;
  --status-radius-lg: 20px;
  --status-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --status-transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Hero Section Enhanced ===== */
.status-hero {
  background: var(--status-gradient);
  padding: 80px 0 60px;
  color: #fff;
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

.status-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2l-2 2V0zm0 4l4-4h2l-6 6V4zm0 4l8-8h2L40 10V8zm0 4L52 0h2L40 14v-2zm0 4L56 0h2L40 18v-2zm0 4L60 0h2L40 22v-2zm0 4L64 0h2L40 26v-2zm0 4L68 0h2L40 30v-2zm0 4L72 0h2L40 34v-2zm0 4L76 0h2L40 38v-2zm0 4L80 0v2L42 40h-2zm4 0L80 4v2L46 40h-2zm4 0L80 8v2L50 40h-2zm4 0l28-28v2L54 40h-2zm4 0l24-24v2L58 40h-2zm4 0l20-20v2L62 40h-2zm4 0l16-16v2L66 40h-2zm4 0l12-12v2L70 40h-2zm4 0l8-8v2l-6 6h-2zm4 0l4-4v2l-2 2h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  animation: heroPattern 60s linear infinite;
}

@keyframes heroPattern {
  0% { transform: translate(0, 0); }
  100% { transform: translate(80px, 80px); }
}

.status-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
  pointer-events: none;
}

.status-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.status-hero .lead {
  font-size: 1.25rem;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0,0,0,0.1);
}

/* ===== Search Box Enhanced ===== */
.status-search-box {
  background: var(--card-bg, #fff);
  padding: 32px;
  border-radius: var(--status-radius-lg);
  box-shadow: var(--status-shadow-lg);
  max-width: 1000px;
  margin: 48px auto 0;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
}

.status-search-box .form-control,
.status-search-box .form-select {
  border-radius: 12px;
  border: 2px solid var(--card-border, #e2e8f0);
  padding: 14px 18px;
  font-size: 15px;
  transition: var(--status-transition);
  background: var(--card-bg, #fff);
}

.status-search-box .form-control:focus,
.status-search-box .form-select:focus {
  border-color: var(--status-primary);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.08);
  transform: translateY(-1px);
}

.status-search-box .input-group-text {
  border-radius: 12px 0 0 12px;
  border: 2px solid var(--card-border, #e2e8f0);
  border-right: none;
  background: var(--card-bg, #fff);
  padding: 14px 18px;
}

.status-search-box .form-control {
  border-left: none;
  border-radius: 0 12px 12px 0;
}

.status-search-box .btn-primary {
  padding: 14px 24px;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.status-search-box .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
}

/* ===== Summary Dashboard Enhanced ===== */
.status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.status-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  color: #0f766e;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: var(--status-transition);
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.status-summary-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(15,118,110,0.05), transparent);
  opacity: 0;
  transition: var(--status-transition);
}

.status-summary-item:hover::before {
  opacity: 1;
}

.status-summary-item:hover {
  background: rgba(255,255,255,1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.5);
}

.status-summary-item.active {
  background: #fff;
  color: var(--status-primary);
  border-color: var(--status-primary);
  box-shadow: 0 6px 24px rgba(15,118,110,0.3);
  transform: translateY(-2px);
}

.status-summary-count {
  background: rgba(15,118,110,0.15);
  padding: 4px 12px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
  color: #0f766e;
}

.status-summary-item.active .status-summary-count {
  background: var(--status-primary);
  color: #fff;
}

/* Individual status type colors for better visibility */
.status-summary-item[data-status-type="operational"] {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}

.status-summary-item[data-status-type="operational"]:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.5);
}

.status-summary-item[data-status-type="operational"].active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.status-summary-item[data-status-type="disrupted"] {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

.status-summary-item[data-status-type="disrupted"]:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.status-summary-item[data-status-type="disrupted"].active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.status-summary-item[data-status-type="under_maintenance"] {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.status-summary-item[data-status-type="under_maintenance"]:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
}

.status-summary-item[data-status-type="under_maintenance"].active {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}

.status-summary-item[data-status-type="planned_outage"] {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.3);
}

.status-summary-item[data-status-type="planned_outage"]:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: rgba(139, 92, 246, 0.5);
}

.status-summary-item[data-status-type="planned_outage"].active {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}

.status-summary-item[data-status-type="under_construction"] {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.3);
}

.status-summary-item[data-status-type="under_construction"]:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.status-summary-item[data-status-type="under_construction"].active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.status-summary-item[data-status-type="not_available"] {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.3);
}

.status-summary-item[data-status-type="not_available"]:hover {
  background: rgba(107, 114, 128, 0.25);
  border-color: rgba(107, 114, 128, 0.5);
}

.status-summary-item[data-status-type="not_available"].active {
  background: #4b5563;
  color: #fff;
  border-color: #4b5563;
}

/* ===== Status Cards Enhanced ===== */
.status-card {
  background: var(--card-bg, #fff);
  border-radius: var(--status-radius);
  overflow: hidden;
  box-shadow: var(--status-shadow-sm);
  transition: var(--status-transition);
  border: 1px solid var(--card-border, #e2e8f0);
  margin-bottom: 20px;
  position: relative;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--status-primary);
  opacity: 0;
  transition: var(--status-transition);
}

.status-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--status-shadow);
  border-color: rgba(15, 118, 110, 0.2);
}

.status-card:hover::before {
  opacity: 1;
}

.status-card-header {
  padding: 20px 26px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--card-border, #e2e8f0);
  background: linear-gradient(to bottom, var(--card-bg, #fff), rgba(248, 250, 252, 0.6));
}

.status-card-body {
  padding: 26px;
}

.status-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--body-color, #1e293b);
  margin-bottom: 12px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.status-card-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--status-transition-fast);
  position: relative;
}

.status-card-title a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--status-primary);
  transition: var(--status-transition-fast);
}

.status-card-title a:hover {
  color: var(--status-primary);
}

.status-card-title a:hover::after {
  width: 100%;
}

.status-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--muted-color, #64748b);
  margin-bottom: 16px;
}

.status-card-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-card-meta-item i {
  font-size: 15px;
  color: var(--status-primary);
}

.status-card-description {
  color: var(--body-color, #475569);
  font-size: 15px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-card-footer {
  padding: 16px 26px;
  background: var(--table-stripe-bg, #f8fafc);
  border-top: 1px solid var(--card-border, #e2e8f0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted-color, #94a3b8);
}

/* ===== Status Type Badges Enhanced ===== */
.status-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid currentColor;
  transition: var(--status-transition);
  position: relative;
  overflow: hidden;
}

.status-type-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: currentColor;
  opacity: 0.1;
  transition: var(--status-transition);
}

.status-type-badge:hover::before {
  opacity: 0.15;
}

.status-type-badge .bi {
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.status-type-badge.operational {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.4);
}

.status-type-badge.disrupted {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.4);
}

.status-type-badge.under_maintenance {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.4);
}

.status-type-badge.planned_outage {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.4);
}

.status-type-badge.under_construction {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.4);
}

.status-type-badge.not_available {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
  border-color: rgba(107, 114, 128, 0.4);
}

/* Animated status indicator */
.status-type-badge::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  animation: statusPulse 2.5s infinite;
  z-index: 1;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.5; transform: translateY(-50%) scale(0.85); }
}

/* ===== Area Tags Enhanced ===== */
.area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.area-tag {
  font-size: 12px;
  padding: 6px 14px;
  background: var(--table-stripe-bg, #f1f5f9);
  border-radius: 14px;
  color: var(--muted-color, #64748b);
  transition: var(--status-transition-fast);
  border: 1px solid transparent;
  font-weight: 500;
}

.area-tag:hover {
  background: var(--status-primary);
  color: #fff;
  border-color: var(--status-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

/* ===== Recently Updated Indicator Enhanced ===== */
.recently-updated {
  color: #f59e0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: recentPulse 2.5s infinite;
  font-size: 13px;
}

.recently-updated i {
  animation: recentBolt 1.5s infinite;
}

@keyframes recentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

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

/* ===== Search Highlight Enhanced ===== */
.search-highlight {
  background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(250, 204, 21, 0.3);
}

/* ===== Pagination Enhanced ===== */
.pagination {
  gap: 8px;
}

.pagination .page-link {
  border: none;
  border-radius: 12px;
  color: var(--body-color, #1e293b);
  font-weight: 600;
  padding: 12px 18px;
  background: var(--card-bg, #fff);
  box-shadow: var(--status-shadow-sm);
  transition: var(--status-transition);
  border: 2px solid transparent;
}

.pagination .page-link:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--status-primary);
  transform: translateY(-3px);
  box-shadow: var(--status-shadow);
  border-color: rgba(15, 118, 110, 0.2);
}

.pagination .page-item.active .page-link {
  background: var(--status-gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.35);
  transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
  background: var(--table-stripe-bg, #f8fafc);
  color: var(--muted-color, #94a3b8);
  box-shadow: none;
}

/* ===== Mobile Responsive Enhanced ===== */
@media (max-width: 768px) {
  .status-hero {
    padding: 50px 0 40px;
    margin-bottom: 32px;
  }
  
  .status-hero h1 {
    font-size: 2rem;
  }
  
  .status-hero .lead {
    font-size: 1rem;
  }
  
  .status-search-box {
    padding: 20px;
    margin-top: 32px;
  }
  
  .status-summary {
    gap: 8px;
    margin-bottom: 24px;
  }
  
  .status-summary-item {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .status-card {
    margin-bottom: 16px;
  }
  
  .status-card-header {
    padding: 16px 20px;
  }
  
  .status-card-body {
    padding: 20px;
  }
  
  .status-card-title {
    font-size: 16px;
  }
}

/* ===== Loading States Enhanced ===== */
.skeleton-loader {
  background: linear-gradient(90deg, 
    var(--table-stripe-bg, #f1f5f9) 25%, 
    var(--card-bg, #fff) 50%, 
    var(--table-stripe-bg, #f1f5f9) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.8s infinite;
  border-radius: 12px;
}

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

/* ===== Dark Mode Enhanced ===== */
[data-theme="dark"] .status-search-box {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .status-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .status-card:hover {
  border-color: rgba(20, 184, 166, 0.3);
}

[data-theme="dark"] .status-card-header {
  background: linear-gradient(to bottom, #1e293b, #0f172a);
  border-bottom-color: #334155;
}

[data-theme="dark"] .status-card-title {
  color: #f1f5f9;
}

[data-theme="dark"] .status-card-footer {
  background: #0f172a;
  border-top-color: #334155;
}

[data-theme="dark"] .area-tag {
  background: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .area-tag:hover {
  background: var(--status-primary);
  color: #fff;
}

[data-theme="dark"] .pagination .page-link {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="dark"] .pagination .page-link:hover {
  background: #334155;
  color: #2dd4bf;
}

/* ===== Accessibility Enhanced ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
  outline: 3px solid var(--status-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.1);
}

.status-card:focus-within {
  outline: 3px solid var(--status-primary);
  outline-offset: 3px;
}

/* ===== High Contrast Mode Enhanced ===== */
@media (prefers-contrast: high) {
  .status-type-badge,
  .status-summary-item,
  .status-card {
    border-width: 3px;
  }
  
  .status-card-title a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
