/* Custom Theme - Professional Blue Palette */
/* Based on AdminLTE with modern color scheme */

:root {
  /* Professional Color Variables - Dynamic from institution settings */
  --primary-blue: #27538C;
  --secondary-blue: #204473;
  --accent-blue: #9BABBF;
  --light-bg: #F2F2F2;
  --dark-text: #212426;
  --medium-bg: #E9ECEF;
  --success-green: #28A745;
  --warning-yellow: #FFC107;
  --danger-red: #DC3545;
  --info-cyan: #17A2B8;
  /* Additional variables for login page */
  --celadon: #204473;
  --mint-cream: #F2F2F2;
  --cambridge-blue: #27538C;
  --caput-mortuum: #212426;
  --black-bean: #212426;
}

/* Override AdminLTE Primary Colors */
.bg-primary {
  background-color: var(--primary-blue, #27538C) !important;
}

.btn-primary {
  background-color: var(--primary-blue, #27538C);
  border-color: var(--primary-blue, #27538C);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--secondary-blue, #204473);
  border-color: var(--secondary-blue, #204473);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(39, 83, 140, 0.3);
}

.text-primary {
  color: var(--primary-blue, #27538C) !important;
}

.card-primary .card-header {
  background: linear-gradient(135deg, var(--primary-blue, #27538C), var(--secondary-blue, #204473)) !important;
  border-bottom-color: var(--primary-blue, #27538C) !important;
  color: white;
}

/* Success Colors */
.btn-success {
  background-color: var(--success-green, #28A745);
  border-color: var(--success-green, #28A745);
  transition: all 0.3s ease;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #1e7e34;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.bg-success {
  background-color: var(--success-green, #28A745) !important;
}

.text-success {
  color: var(--success-green, #28A745) !important;
}

/* Light Backgrounds */
.bg-light {
  background-color: var(--light-bg, #F2F2F2) !important;
}

.card-light .card-header {
  background-color: var(--light-bg, #F2F2F2) !important;
  border-bottom: 1px solid var(--medium-bg, #E9ECEF);
}

/* Dark Text Colors */
.text-dark {
  color: var(--dark-text, #212426) !important;
}

.text-muted {
  color: var(--dark-text, #212426) !important;
  opacity: 0.7;
}

/* Navigation and Sidebar */
.main-sidebar {
  background: linear-gradient(180deg, var(--primary-blue, #27538C), var(--secondary-blue, #204473)) !important;
}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-left-color: var(--accent-blue, #9BABBF) !important;
  color: white !important;
}

.nav-sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}

.nav-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s ease;
}

/* Table Styling */
.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--light-bg, #F2F2F2);
}

.table-hover tbody tr:hover {
  background-color: var(--medium-bg, #E9ECEF);
  transform: scale(1.01);
  transition: all 0.2s ease;
}

.table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Elements */
.form-control {
  border: 2px solid var(--medium-bg, #E9ECEF);
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: white;
}

.form-control:focus {
  border-color: var(--primary-blue, #27538C);
  box-shadow: 0 0 0 0.2rem rgba(39, 83, 140, 0.15);
  transform: translateY(-1px);
}

.custom-select:focus {
  border-color: var(--primary-blue, #27538C);
  box-shadow: 0 0 0 0.2rem rgba(39, 83, 140, 0.15);
  transform: translateY(-1px);
}

/* Badge Colors */
.badge-primary {
  background-color: var(--cambridge-blue, #27538C);
}

.badge-success {
  background-color: var(--celadon, #204473);
}

/* Progress Bars */
.progress-bar {
  background-color: var(--cambridge-blue, #27538C);
}

/* Alert Colors */
.alert-success {
  background-color: var(--mint-cream, #F2F2F2);
  border-color: var(--celadon, #204473);
  color: var(--caput-mortuum, #212426);
}

/* Card Headers */
.card-header {
  background: linear-gradient(135deg, var(--light-bg, #F2F2F2), var(--medium-bg, #E9ECEF)) !important;
  border-bottom: 2px solid var(--primary-blue, #27538C) !important;
  border-radius: 8px 8px 0 0 !important;
}

.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Job Card Modern Styling */
.job-card-modern {
  border: 2px solid var(--medium-bg, #E9ECEF) !important;
  transition: all 0.3s ease;
}

.job-card-modern:hover {
  border-color: var(--primary-blue, #27538C) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(39, 83, 140, 0.2);
}

.job-card-modern .card-header {
  background: linear-gradient(135deg, var(--primary-blue, #27538C), var(--secondary-blue, #204473)) !important;
  border: none;
  color: white;
}

.job-card-modern .card-footer {
  background: linear-gradient(135deg, var(--light-bg, #F2F2F2), var(--medium-bg, #E9ECEF)) !important;
  border-top: 2px solid var(--primary-blue, #27538C) !important;
}

/* Pagination */
.page-link {
  color: var(--cambridge-blue, #27538C);
  border-color: var(--celadon, #204473);
}

.page-link:hover {
  color: var(--caput-mortuum, #212426);
  background-color: var(--celadon, #204473);
  border-color: var(--cambridge-blue, #27538C);
}

.page-item.active .page-link {
  background-color: var(--cambridge-blue, #27538C);
  border-color: var(--cambridge-blue, #27538C);
}

/* Modal Headers */
.modal-header {
  background-color: var(--mint-cream, #F2F2F2);
  border-bottom: 1px solid var(--celadon, #204473);
}

/* Dropdown Menus */
.dropdown-menu .dropdown-item:hover {
  background-color: var(--mint-cream, #F2F2F2);
}

/* Custom Gradients */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--cambridge-blue, #27538C), var(--celadon, #204473)) !important;
}

.bg-gradient-success {
  background: linear-gradient(135deg, var(--celadon, #204473), var(--mint-cream, #F2F2F2)) !important;
}

/* Links */
a {
  color: var(--cambridge-blue, #27538C);
}

a:hover {
  color: var(--caput-mortuum, #212426);
}

/* List Group */
.list-group-item {
  border-color: var(--celadon, #204473);
}

.list-group-item:hover {
  background-color: var(--mint-cream, #F2F2F2);
}

/* Breadcrumbs */
.breadcrumb {
  background-color: var(--mint-cream, #F2F2F2);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--caput-mortuum, #212426);
}

/* Tabs */
.nav-tabs .nav-link.active {
  background-color: var(--mint-cream, #F2F2F2);
  border-color: var(--celadon, #204473) var(--celadon, #204473) #fff;
  color: var(--caput-mortuum, #212426);
}

/* Accordion */
.accordion-button {
  background-color: var(--mint-cream, #F2F2F2);
  color: var(--caput-mortuum, #212426);
}

.accordion-button:not(.collapsed) {
  background-color: var(--celadon, #204473);
  color: var(--caput-mortuum, #212426);
}

/* Toast Notifications */
.toast {
  background-color: var(--mint-cream, #F2F2F2);
  border-color: var(--celadon, #204473);
}

.toast-header {
  background-color: var(--celadon, #204473);
  color: var(--caput-mortuum, #212426);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--mint-cream, #F2F2F2);
}

::-webkit-scrollbar-thumb {
  background: var(--cambridge-blue, #27538C);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--celadon, #204473);
}

/* Additional Responsive Improvements */
@media (max-width: 768px) {
  /* Card improvements for mobile */
  .card {
    margin-bottom: 1rem;
    border-radius: 12px !important;
  }

  .card-header {
    padding: 1rem !important;
    border-radius: 12px 12px 0 0 !important;
  }

  .card-body {
    padding: 1rem !important;
  }

  .card-footer {
    padding: 1rem !important;
    border-radius: 0 0 12px 12px !important;
  }

  /* Button improvements for mobile */
  .btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.25rem !important;
  }

  .btn-group-vertical .btn {
    margin-bottom: 0.25rem !important;
  }

  /* Form improvements */
  .form-control {
    font-size: 1rem !important; /* Prevent zoom on iOS */
  }

  /* Badge improvements */
  .badge {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
  }

  /* Job card specific mobile improvements */
  .job-card-modern {
    margin-bottom: 1.5rem !important;
  }

  .job-card-modern .card-header {
    padding: 1.5rem 1rem 1rem !important;
  }

  .job-card-modern .card-body {
    padding: 1.5rem 1rem !important;
  }

  .job-card-modern .card-footer {
    padding: 1rem !important;
  }

  .detail-row {
    padding: 0.5rem !important;
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }

  /* Navigation improvements */
  .navbar-nav .nav-link {
    padding: 0.5rem 1rem !important;
  }

  /* Modal improvements */
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
  }

  /* Pagination improvements */
  .pagination {
    flex-wrap: wrap;
    justify-content: center !important;
  }

  .page-link {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.875rem !important;
  }

  /* Alert improvements */
  .alert {
    padding: 0.75rem 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 8px !important;
  }
}

@media (max-width: 576px) {
  /* Extra small screens */
  .container-fluid {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .card {
    border-radius: 8px !important;
  }

  .btn {
    width: 100% !important;
    margin-bottom: 0.5rem !important;
  }

  .job-card-modern .card-footer .row .col-6 {
    padding: 0.25rem !important;
  }

  .job-card-modern .card-footer .btn {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.25rem !important;
    min-height: 2.2rem !important;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px !important; /* iOS touch target size */
  }

  .nav-link {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--caput-mortuum) !important;
  }

  .btn {
    border: 2px solid !important;
  }

  .table {
    border: 2px solid var(--caput-mortuum) !important;
  }

  .table th,
  .table td {
    border: 1px solid var(--caput-mortuum) !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .job-card-modern,
  .btn,
  .card,
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Loading States */
.spinner-border {
  color: var(--cambridge-blue, #27538C);
}

/* Focus States */
.btn:focus,
.form-control:focus,
.custom-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(121, 183, 145, 0.25) !important;
}

/* Custom Utility Classes */
.bg-primary-blue {
  background-color: var(--primary-blue, #27538C) !important;
}

.bg-secondary-blue {
  background-color: var(--secondary-blue, #204473) !important;
}

.bg-accent-blue {
  background-color: var(--accent-blue, #9BABBF) !important;
}

.bg-light-bg {
  background-color: var(--light-bg, #F2F2F2) !important;
}

.bg-dark-text {
  background-color: var(--dark-text, #212426) !important;
}

.bg-medium-bg {
  background-color: var(--medium-bg, #E9ECEF) !important;
}

.text-primary-blue {
  color: var(--primary-blue, #27538C) !important;
}

.text-secondary-blue {
  color: var(--secondary-blue, #204473) !important;
}

.text-accent-blue {
  color: var(--accent-blue, #9BABBF) !important;
}

.text-light-bg {
  color: var(--light-bg, #F2F2F2) !important;
}

.text-dark-text {
  color: var(--dark-text, #212426) !important;
}

.text-medium-bg {
  color: var(--medium-bg, #E9ECEF) !important;
}

.border-primary-blue {
  border-color: var(--primary-blue, #27538C) !important;
}

.border-secondary-blue {
  border-color: var(--secondary-blue, #204473) !important;
}

.border-accent-blue {
  border-color: var(--accent-blue, #9BABBF) !important;
}

.border-light-bg {
  border-color: var(--light-bg, #F2F2F2) !important;
}

.border-dark-text {
  border-color: var(--dark-text, #212426) !important;
}

.border-medium-bg {
  border-color: var(--medium-bg, #E9ECEF) !important;
}

/* Modern Button Styles */
.btn-modern {
  border-radius: 25px;
  padding: 10px 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

/* Glass Effect Cards */
.card-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Gradient Backgrounds */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-blue, #27538C), var(--secondary-blue, #204473)) !important;
}

.bg-gradient-success {
  background: linear-gradient(135deg, var(--success-green, #28A745), #20c997) !important;
}

.bg-gradient-warning {
  background: linear-gradient(135deg, var(--warning-yellow, #FFC107), #fd7e14) !important;
}

.bg-gradient-danger {
  background: linear-gradient(135deg, var(--danger-red, #DC3545), #e83e8c) !important;
}

.bg-gradient-info {
  background: linear-gradient(135deg, var(--info-cyan, #17A2B8), #0dcaf0) !important;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}