/**
 * Almurakib Fuel Prices Widget - Compact Light Theme
 * Version: 3.1.0
 * Modern, Clean, Professional Design - Optimized Sizes
 */

/* ========================================
   CSS Variables - Light Premium Theme
======================================== */
.alm-fuel-widget {
  --alm-primary: #2563eb;
  --alm-primary-light: #3b82f6;
  --alm-secondary: #7c3aed;
  --alm-accent: #f59e0b;
  --alm-success: #10b981;
  --alm-info: #06b6d4;
  
  --alm-bg: linear-gradient(145deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
  --alm-card-bg: #ffffff;
  --alm-card-border: rgba(148, 163, 184, 0.2);
  --alm-card-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.04), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
  --alm-card-shadow-hover: 0 8px 20px -6px rgba(0, 0, 0, 0.12);
  
  --alm-text-primary: #1e293b;
  --alm-text-secondary: #475569;
  --alm-text-muted: #64748b;
  --alm-text-light: #94a3b8;
  
  --alm-border-radius-sm: 8px;
  --alm-border-radius-md: 12px;
  --alm-border-radius-lg: 16px;
  --alm-border-radius-xl: 20px;
  
  --alm-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --alm-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Base Styles
======================================== */
.alm-fuel-widget,
.alm-fuel-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.alm-fuel-widget {
  position: relative;
  overflow: hidden;
  border-radius: var(--alm-border-radius-xl);
  padding: 20px;
  background: var(--alm-bg);
  color: var(--alm-text-primary);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--alm-card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  direction: rtl;
}

/* Decorative Background Elements */
.alm-fuel-widget::before,
.alm-fuel-widget::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

.alm-fuel-widget::before {
  width: 200px;
  height: 200px;
  top: -60px;
  right: -50px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.08));
}

.alm-fuel-widget::after {
  width: 160px;
  height: 160px;
  bottom: -50px;
  left: -40px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(16, 185, 129, 0.08));
}

/* ========================================
   Header Section
======================================== */
.alm-fuel-head {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.alm-fuel-head__content {
  flex: 1 1 auto;
  min-width: 200px;
}

/* Badge */
.alm-fuel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--alm-primary);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
}

.alm-fuel-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--alm-success);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Title */
.alm-fuel-title {
  margin: 0 0 10px;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--alm-text-primary);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--alm-text-primary) 0%, var(--alm-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Meta Information */
.alm-fuel-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alm-fuel-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--alm-text-secondary);
  border-radius: var(--alm-border-radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: var(--alm-transition-fast);
}

.alm-fuel-meta span:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.alm-fuel-meta strong {
  color: var(--alm-text-primary);
  font-weight: 600;
}

/* Date Cards */
.alm-fuel-head__dates {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.alm-fuel-date-card {
  position: relative;
  min-width: 120px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--alm-border-radius-sm);
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: var(--alm-transition);
  overflow: hidden;
}

.alm-fuel-date-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--alm-primary), var(--alm-secondary));
}

.alm-fuel-date-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.alm-fuel-date-card__label {
  display: block;
  font-size: 10px;
  color: var(--alm-text-muted);
  margin-bottom: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alm-fuel-date-card strong {
  color: var(--alm-text-primary);
  font-size: 12px;
  font-weight: 600;
}

/* ========================================
   Fuel Cards Grid - Responsive Columns
======================================== */
.alm-fuel-grid {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}

/* Auto columns (default) - responsive */
.alm-cols-auto .alm-fuel-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* 2 columns - with responsive behavior */
.alm-cols-2 .alm-fuel-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 columns - with responsive behavior */
.alm-cols-3 .alm-fuel-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* 4 columns - with responsive behavior */
.alm-cols-4 .alm-fuel-grid {
  grid-template-columns: repeat(4, 1fr);
}

/* 5 columns - with responsive behavior */
.alm-cols-5 .alm-fuel-grid {
  grid-template-columns: repeat(5, 1fr);
}

/* 6 columns - with responsive behavior */
.alm-cols-6 .alm-fuel-grid {
  grid-template-columns: repeat(6, 1fr);
}

/* ========================================
   Fuel Card - Compact Design
======================================== */
.alm-fuel-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 16px;
  border-radius: var(--alm-border-radius-md);
  background: var(--alm-card-bg);
  border: 1px solid var(--alm-card-border);
  box-shadow: var(--alm-card-shadow);
  transition: var(--alm-transition);
  cursor: default;
}

.alm-fuel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--alm-card-shadow-hover);
  border-color: rgba(148, 163, 184, 0.3);
}

/* Card Glow Effect */
.alm-fuel-card__glow {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(35px);
  opacity: 0.12;
  z-index: -1;
  transition: var(--alm-transition);
}

.alm-fuel-card:hover .alm-fuel-card__glow {
  opacity: 0.2;
  transform: scale(1.1);
}

/* Card Top Section */
.alm-fuel-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Fuel Icon */
.alm-fuel-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--alm-border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.1);
  color: var(--alm-primary);
  flex: 0 0 40px;
  transition: var(--alm-transition);
}

.alm-fuel-card:hover .alm-fuel-icon {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.alm-fuel-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
}

/* Card Titles */
.alm-fuel-card__titles h3 {
  margin: 0 0 2px;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--alm-text-primary);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.alm-fuel-card__titles p {
  margin: 0;
  color: var(--alm-text-muted);
  font-size: 11px;
  font-weight: 500;
}

/* Price Section */
.alm-fuel-price-wrap {
  margin: 12px 0;
  padding: 10px 0 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.alm-fuel-price-row {
  gap: 2px;
}

.alm-fuel-price {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--alm-text-primary);
  transition: var(--alm-transition);
}

.alm-fuel-card:hover .alm-fuel-price {
  color: var(--alm-primary);
}

.alm-fuel-unit {
  color: var(--alm-text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 9px 6px 0 0 !important;
}

/* Card Footer */
.alm-fuel-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.alm-fuel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 100px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.05));
  color: var(--alm-primary);
  border: 1px solid rgba(37, 99, 235, 0.1);
  transition: var(--alm-transition-fast);
}

.alm-fuel-pill:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.08));
  border-color: rgba(37, 99, 235, 0.2);
}

.alm-fuel-pill--soft {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.05));
  color: var(--alm-success);
  border-color: rgba(16, 185, 129, 0.12);
}

.alm-fuel-pill--soft::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--alm-success);
  border-radius: 50%;
}

/* ========================================
   Fuel Type Specific Colors
======================================== */
/* Gasoline - Orange/Amber Theme */
.alm-fuel-card--gasoline_80 .alm-fuel-icon,
.alm-fuel-card--gasoline_90 .alm-fuel-icon,
.alm-fuel-card--gasoline_91 .alm-fuel-icon,
.alm-fuel-card--gasoline_92 .alm-fuel-icon,
.alm-fuel-card--gasoline_95 .alm-fuel-icon,
.alm-fuel-card--gasoline_98 .alm-fuel-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(249, 115, 22, 0.08));
  border-color: rgba(245, 158, 11, 0.18);
  color: #d97706;
}

.alm-fuel-card--gasoline_80 .alm-fuel-card__glow,
.alm-fuel-card--gasoline_90 .alm-fuel-card__glow,
.alm-fuel-card--gasoline_91 .alm-fuel-card__glow,
.alm-fuel-card--gasoline_92 .alm-fuel-card__glow,
.alm-fuel-card--gasoline_95 .alm-fuel-card__glow,
.alm-fuel-card--gasoline_98 .alm-fuel-card__glow {
  background: #f59e0b;
}

.alm-fuel-card--gasoline_80:hover .alm-fuel-price,
.alm-fuel-card--gasoline_90:hover .alm-fuel-price,
.alm-fuel-card--gasoline_91:hover .alm-fuel-price,
.alm-fuel-card--gasoline_92:hover .alm-fuel-price,
.alm-fuel-card--gasoline_95:hover .alm-fuel-price,
.alm-fuel-card--gasoline_98:hover .alm-fuel-price {
  color: #d97706;
}

/* Diesel - Blue Theme */
.alm-fuel-card--diesel .alm-fuel-icon {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(14, 165, 233, 0.08));
  border-color: rgba(6, 182, 212, 0.18);
  color: #0891b2;
}

.alm-fuel-card--diesel .alm-fuel-card__glow {
  background: #06b6d4;
}

.alm-fuel-card--diesel:hover .alm-fuel-price {
  color: #0891b2;
}

/* Kerosene - Purple Theme */
.alm-fuel-card--kerosene .alm-fuel-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(139, 92, 246, 0.08));
  border-color: rgba(124, 58, 237, 0.18);
  color: #7c3aed;
}

.alm-fuel-card--kerosene .alm-fuel-card__glow {
  background: #8b5cf6;
}

.alm-fuel-card--kerosene:hover .alm-fuel-price {
  color: #7c3aed;
}

/* LPG - Green Theme */
.alm-fuel-card--lpg .alm-fuel-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.08));
  border-color: rgba(16, 185, 129, 0.18);
  color: #059669;
}

.alm-fuel-card--lpg .alm-fuel-card__glow {
  background: #10b981;
}

.alm-fuel-card--lpg:hover .alm-fuel-price {
  color: #059669;
}

/* ========================================
   Notice Message
======================================== */
.alm-fuel-notice {
  padding: 14px 18px;
  border-radius: var(--alm-border-radius-sm);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  color: var(--alm-text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
  box-shadow: var(--alm-card-shadow);
}

/* ========================================
   Animations
======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alm-fuel-card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.alm-fuel-card:nth-child(1) { animation-delay: 0.05s; }
.alm-fuel-card:nth-child(2) { animation-delay: 0.1s; }
.alm-fuel-card:nth-child(3) { animation-delay: 0.15s; }
.alm-fuel-card:nth-child(4) { animation-delay: 0.2s; }
.alm-fuel-card:nth-child(5) { animation-delay: 0.25s; }
.alm-fuel-card:nth-child(6) { animation-delay: 0.3s; }
.alm-fuel-card:nth-child(7) { animation-delay: 0.35s; }
.alm-fuel-card:nth-child(8) { animation-delay: 0.4s; }
.alm-fuel-card:nth-child(9) { animation-delay: 0.45s; }

/* ========================================
   Responsive Design
======================================== */

/* Tablet and below */
@media (max-width: 991px) {
  .alm-fuel-widget {
    padding: 18px;
  }
  
  .alm-fuel-head {
    gap: 14px;
  }
}

/* Mobile landscape and below */
@media (max-width: 768px) {
  .alm-fuel-widget {
    padding: 16px;
    border-radius: var(--alm-border-radius-lg);
  }
  
  .alm-fuel-head {
    flex-direction: column;
    gap: 12px;
  }
  
  .alm-fuel-head__content {
    min-width: 100%;
  }
  
  .alm-fuel-head__dates {
    width: 100%;
  }
  
  .alm-fuel-date-card {
    flex: 1;
    min-width: 100px;
  }
  
  /* Force all column layouts to 2 columns on tablets */
  .alm-cols-2 .alm-fuel-grid,
  .alm-cols-3 .alm-fuel-grid,
  .alm-cols-4 .alm-fuel-grid,
  .alm-cols-5 .alm-fuel-grid,
  .alm-cols-6 .alm-fuel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .alm-fuel-card {
    padding: 14px;
  }
  
  .alm-fuel-title {
    font-size: 18px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .alm-fuel-widget {
    padding: 14px;
    border-radius: var(--alm-border-radius-md);
  }
  
  .alm-fuel-card {
    padding: 12px;
  }
  
  .alm-fuel-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }
  
  .alm-fuel-icon svg {
    width: 18px;
    height: 18px;
  }
  
  .alm-fuel-card__titles h3 {
    font-size: 14px;
  }
  
  .alm-fuel-price {
    font-size: 22px;
  }
  
  .alm-fuel-badge {
    padding: 4px 10px;
    font-size: 10px;
  }
  
  .alm-fuel-pill {
    padding: 3px 8px;
    font-size: 9px;
  }
  
  /* Force single column on very small screens */
  .alm-cols-auto .alm-fuel-grid,
  .alm-cols-2 .alm-fuel-grid,
  .alm-cols-3 .alm-fuel-grid,
  .alm-cols-4 .alm-fuel-grid,
  .alm-cols-5 .alm-fuel-grid,
  .alm-cols-6 .alm-fuel-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Print Styles
======================================== */
@media print {
  .alm-fuel-widget {
    background: #ffffff;
    box-shadow: none;
    border: 1px solid #e2e8f0;
  }
  
  .alm-fuel-widget::before,
  .alm-fuel-widget::after {
    display: none;
  }
  
  .alm-fuel-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    animation: none;
    opacity: 1;
  }
  
  .alm-fuel-card__glow {
    display: none;
  }
}