:root {
  --bs-primary: #1a2980;
  --bs-primary-rgb: 26, 41, 128;
  --bs-info: #26d0ce;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: #121d5c !important; /* Darker shade */
  border-color: #121d5c !important;
}

.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-outline-primary:hover {
  background-color: var(--bs-primary) !important;
  color: white !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

.text-primary {
  color: var(--bs-primary) !important;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(26, 41, 128, 0.25);
  border-color: var(--bs-primary);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Custom UI Components */
.stat-card {
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}
.stat-icon {
    position: absolute;
    left: 20px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.15;
    transform: rotate(-15deg);
    transition: all 0.3s ease;
}
.stat-card:hover .stat-icon {
    transform: rotate(0) scale(1.1);
    opacity: 0.25;
}

/* Gradients */
.bg-gradient-primary { background: linear-gradient(135deg, #4e54c8 0%, #8f94fb 100%); }
.bg-gradient-success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.bg-gradient-warning { background: linear-gradient(135deg, #f2994a 0%, #f2c94c 100%); }
.bg-gradient-info { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); }
.bg-gradient-dark { background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%); }

/* Modern Cards */
.modern-card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.modern-card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px 16px 0 0 !important;
    padding: 1.25rem 1.5rem;
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-right: 30px;
    margin-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: -20px;
    width: 2px;
    background-color: #e9ecef;
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-icon {
    position: absolute;
    right: -9px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #4e54c8;
}

/* Sidebar and Layout Utilities */
.sidebar-wrapper {
    width: 250px;
    height: 100vh;
}
.main-content-wrapper {
    margin-right: 250px;
    min-height: 100vh;
}
.profile-avatar {
    width: 40px;
    height: 40px;
}

/* Other Custom Utilities */
.cursor-pointer { cursor: pointer; }
.z-index-100 { z-index: 100; }
.min-w-100px { min-width: 100px; }
.min-h-100vh { min-height: 100vh; }
.max-w-130px { max-width: 130px; }
.max-w-130px { max-width: 130px; }
.max-w-250px { max-width: 250px; }
.max-w-300px { max-width: 300px; }
.max-w-400px { max-width: 400px; }
.max-w-1000px { max-width: 1000px; }

/* Font Utilities */
.font-cairo { font-family: 'Cairo', sans-serif; }
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.85rem !important; }
.fs-2xl { font-size: 3rem !important; }
.fs-3xl { font-size: 3.5rem !important; }
.fs-4xl { font-size: 5rem !important; }
.letter-spacing-sm { letter-spacing: -0.5px !important; }
.fw-medium { font-weight: 500 !important; }

/* Color Utilities */
.text-custom-primary { color: #1a2980 !important; }
.text-custom-dark { color: #2c3e50 !important; }
.text-custom-success { color: #27ae60 !important; }
.text-custom-gray { color: #555 !important; }
.bg-custom-info { background-color: #26d0ce !important; }

/* Margin Utilities */
.mt-n2px { margin-top: -2px !important; }

/* Border Utilities */
.border-custom-light { border-top: 1px solid rgba(0,0,0,0.05) !important; }
.border-end-custom { border-right: 4px solid #26d0ce !important; }

/* Image Utilities */
.max-h-100px { max-height: 100px; }
.max-h-120px { max-height: 120px; }
.h-300px { height: 300px; }
.w-48px { width: 48px; }
.h-48px { height: 48px; }
.spinner-sm-custom { width: 0.8rem; height: 0.8rem; }

/* Sidebar Responsive */
@media (max-width: 768px) { 
    #sidebar { 
        position: fixed; 
        right: 0; 
        top: 0; 
        z-index: 1050; 
        box-shadow: -5px 0 15px rgba(0,0,0,0.2) !important; 
    } 
    #sidebar.d-none { 
        display: none !important; 
    } 
}

/* Sidebar Custom Classes */
.sidebar-container { min-width: 270px; height: 100vh; transition: all 0.3s; }
.logo-wrapper { width: 50px; height: 50px; padding: 2px; }
.object-fit-contain { object-fit: contain; }
.avatar-sm { width: 35px; height: 35px; }
.max-w-120px { max-width: 120px; }

.sidebar-link {
    transition: all 0.2s ease-in-out;
    opacity: 0.85;
}
.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    opacity: 1;
    transform: translateX(-6px);
}
.sidebar-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    font-weight: bold;
}
.sidebar-link.active .sidebar-icon {
    color: #ffffff !important;
}
