/* ========================================
   OSAG SOMALIA - UI COMPONENTS
   Modern Component Library
   ======================================== */

/* ========================================
   BADGES & LABELS
   ======================================== */

.badge-modern {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  background: var(--light-blue);
  color: var(--primary-blue);
}

.badge-gold {
  background: var(--soft-gold);
  color: #B8860B;
}

.badge-success {
  background: #D4EDDA;
  color: var(--accent-green);
}

.badge-info {
  background: var(--light-blue);
  color: var(--dark-blue);
}

/* ========================================
   ALERTS & NOTIFICATIONS
   ======================================== */

.alert-modern {
  padding: 20px 24px;
  border-radius: 12px;
  border-left: 4px solid;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.alert-modern i {
  font-size: 24px;
}

.alert-success {
  background: #D4EDDA;
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.alert-info {
  background: var(--light-blue);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.alert-warning {
  background: #FFF4CC;
  border-color: #FFC107;
  color: #856404;
}

.alert-error {
  background: #F8D7DA;
  border-color: #DC3545;
  color: #721C24;
}

/* ========================================
   BREADCRUMBS
   ======================================== */

.breadcrumb-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  font-size: 0.9rem;
}

.breadcrumb-modern a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-modern a:hover {
  color: var(--primary-blue);
}

.breadcrumb-modern .separator {
  color: var(--text-secondary);
}

.breadcrumb-modern .active {
  color: var(--primary-blue);
  font-weight: 600;
}

/* ========================================
   TABLES
   ======================================== */

.table-modern {
  width: 100%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.night-mode .table-modern {
  background: rgba(44, 62, 80, 0.6);
}

.table-modern thead {
  background: var(--primary-blue);
  color: white;
  border-radius: 16px;
}

.table-modern th {
  padding: 16px 20px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.table-modern td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.night-mode .table-modern td {
  color: var(--primary-white);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.table-modern tbody tr:hover {
  background: var(--light-blue);
}

.night-mode .table-modern tbody tr:hover {
  background: rgba(65, 143, 222, 0.1);
}

.table-modern tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination-modern {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 32px 0;
}

.pagination-modern a,
.pagination-modern span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: white;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.pagination-modern a:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-2px);
}

.pagination-modern .active {
  background: var(--primary-blue);
  color: white;
}

.pagination-modern .disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   MODALS
   ======================================== */

.modal-modern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-modern.active {
  opacity: 1;
  visibility: visible;
}

.modal-content-modern {
  background: white;
  border-radius: 24px;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-modern.active .modal-content-modern {
  transform: scale(1);
}

.night-mode .modal-content-modern {
  background: var(--charcoal-black);
  color: white;
}

.modal-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}

.modal-header-modern h3 {
  margin: 0;
  color: var(--primary-blue);
  font-size: 1.75rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--primary-blue);
}

/* ========================================
   TABS
   ======================================== */

.tabs-modern {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 32px;
}

.tab-item {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.tab-item:hover {
  color: var(--primary-blue);
}

.tab-item.active {
  color: var(--primary-blue);
}

.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-blue);
  border-radius: 2px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ========================================
   ACCORDION
   ======================================== */

.accordion-modern {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.night-mode .accordion-modern {
  background: rgba(44, 62, 80, 0.6);
}

.accordion-header {
  padding: 20px 24px;
  background: var(--light-blue);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.night-mode .accordion-header {
  background: rgba(65, 143, 222, 0.1);
}

.accordion-header:hover {
  background: var(--primary-blue);
  color: white;
}

.accordion-header h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.accordion-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.accordion-modern.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-modern.active .accordion-body {
  max-height: 1000px;
}

.accordion-content {
  padding: 24px;
  color: var(--text-primary);
  line-height: 1.7;
}

.night-mode .accordion-content {
  color: var(--primary-white);
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress-modern {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 50px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--medium-blue) 100%);
  border-radius: 50px;
  transition: width 0.5s ease;
}

.progress-bar.gold {
  background: linear-gradient(90deg, var(--accent-gold) 0%, #FFC700 100%);
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip-modern {
  position: relative;
  display: inline-block;
}

.tooltip-modern .tooltip-text {
  visibility: hidden;
  opacity: 0;
  background: var(--charcoal-black);
  color: white;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.tooltip-modern .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--charcoal-black);
}

.tooltip-modern:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ========================================
   SEARCH BAR
   ======================================== */

.search-modern {
  position: relative;
  max-width: 500px;
  width: 100%;
}

.search-modern input {
  width: 100%;
  padding: 14px 48px 14px 20px;
  border: 2px solid var(--border-color);
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-modern input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(65, 143, 222, 0.1);
}

.search-modern button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-blue);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-modern button:hover {
  background: var(--dark-blue);
  transform: translateY(-50%) scale(1.1);
}

/* ========================================
   STATS/KPI CARDS
   ======================================== */

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-blue);
  transition: all 0.3s ease;
}

.night-mode .stat-card {
  background: rgba(44, 62, 80, 0.6);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card.gold {
  border-left-color: var(--accent-gold);
}

.stat-card.green {
  border-left-color: var(--accent-green);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-icon {
  font-size: 48px;
  color: var(--light-blue);
  margin-bottom: 16px;
}

/* ========================================
   TIMELINE
   ======================================== */

.timeline-modern {
  position: relative;
  padding: 32px 0;
}

.timeline-modern::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-blue);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: 40px;
}

.timeline-marker {
  position: absolute;
  left: 18px;
  width: 24px;
  height: 24px;
  background: var(--primary-blue);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--light-blue);
}

.timeline-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.night-mode .timeline-content {
  background: rgba(44, 62, 80, 0.6);
}

.timeline-date {
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
  .modal-content-modern {
    padding: 24px;
  }
  
  .table-modern {
    font-size: 0.875rem;
  }
  
  .table-modern th,
  .table-modern td {
    padding: 12px;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .timeline-modern::before {
    left: 15px;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .timeline-marker {
    left: 6px;
  }
}
