/* ===== GLOBAL OVERFLOW FIX ===== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== CSS VARIABLES ===== */
:root {
  --color-primary: #2c5aa0;
  --color-secondary: #1e3a8a;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --color-light: #f8fafc;
  --color-dark: #1e293b;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;
  
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Open Sans', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius: 0.5rem;
  --border-radius-lg: 0.75rem;
  --border-radius-xl: 1rem;
  
  --transition: all 0.3s ease;
}

/* ===== NAVBAR MOBILE TOGGLER ===== */
.custom-toggler {
  border: 2px solid var(--color-primary) !important;
  border-radius: 10px !important;
  padding: 0.65rem 0.9rem !important;
  background: linear-gradient(135deg, white 0%, #f8fafc 100%) !important;
  box-shadow: 0 4px 12px rgba(44, 90, 160, 0.2);
  position: relative;
  transition: var(--transition);
}

.custom-toggler:hover {
  background: var(--color-primary) !important;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(44, 90, 160, 0.35);
}

.custom-toggler:hover i {
  color: white !important;
}

.custom-toggler i {
  color: var(--color-primary);
  font-size: 1.4rem;
  transition: var(--transition);
  font-weight: 600;
}

.custom-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.25) !important;
}

.toggler-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

/* Hide default Bootstrap toggler icon */
.custom-toggler .navbar-toggler-icon {
  display: none;
}

/* ===== MOBILE LOGOUT BUTTON ===== */
.mobile-logout-btn {
  display: none; /* Hidden by default, JavaScript will show when logged in */
  flex-direction: row; /* Always ready for flex display */
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--color-danger) !important;
  border-radius: 10px !important;
  padding: 0.65rem 0.9rem !important;
  background: linear-gradient(135deg, white 0%, #fef2f2 100%) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  position: relative;
  transition: var(--transition);
  color: var(--color-danger);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-style: solid;
}

.mobile-logout-btn:hover {
  background: var(--color-danger) !important;
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.mobile-logout-btn:hover i,
.mobile-logout-btn:hover .logout-label {
  color: white !important;
}

.mobile-logout-btn i {
  color: var(--color-danger);
  font-size: 1.4rem;
  transition: var(--transition);
  font-weight: 600;
}

.mobile-logout-btn .logout-label {
  color: var(--color-danger);
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
}

.mobile-logout-btn:focus {
  box-shadow: 0 0 0 0.25rem rgba(239, 68, 68, 0.25) !important;
}

/* Hide mobile logout button on desktop */
@media (min-width: 992px) {
  .mobile-logout-btn {
    display: none !important;
  }
}

/* Mobile navbar improvements */
@media (max-width: 991px) {
  .custom-toggler {
    padding: 0.85rem 1.1rem !important;
    margin-left: 0 !important;
    margin-right: 0.75rem;
    order: 1;
  }
  
  .custom-toggler i {
    font-size: 1.6rem;
  }
  
  .navbar-brand {
    order: 3;
    margin-left: 0.75rem;
  }
  
  .navbar-brand img {
    height: 45px !important;
  }
  
  .toggler-badge {
    width: 30px;
    height: 30px;
    font-size: 15px;
    top: -12px;
    right: -12px;
    border: 2px solid white;
  }
  
  /* Make navbar container flex for better alignment */
  .navbar .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
  }
  
  /* Mobile logout button - visible only on mobile when logged in */
  .mobile-logout-btn {
    /* display controlled by JavaScript based on login state */
    padding: 0.85rem 1.1rem !important;
    margin-left: 0;
    margin-right: 0.75rem;
    order: 2;
    white-space: nowrap;
  }
  
  .mobile-logout-btn i {
    font-size: 1.6rem;
  }
  
  .mobile-logout-btn .logout-label {
    display: inline;
    font-size: 0.95rem;
  }
}

@media (max-width: 576px) {
  .custom-toggler {
    padding: 0.75rem 0.95rem !important;
  }
  
  .custom-toggler i {
    font-size: 1.5rem;
  }
  
  .navbar-brand img {
    height: 38px !important;
  }
  
  .mobile-logout-btn {
    padding: 0.75rem 0.95rem !important;
  }
  
  .mobile-logout-btn i {
    font-size: 1.5rem;
  }
  
  .mobile-logout-btn .logout-label {
    font-size: 0.85rem;
  }
}

/* ===== MODAL FIXES ===== */
.modal-backdrop {
  display: none !important;
}

.modal {
  background: rgba(0, 0, 0, 0.5) !important;
}

.modal.show {
  background: rgba(0, 0, 0, 0.5) !important;
}

/* ===== OFERTA FORMATIVA STYLES ===== */
.courses-nav-tabs {
  background: var(--color-light);
  border-radius: var(--border-radius);
  padding: 0.5rem;
  margin-bottom: 2rem;
}

.courses-nav-tabs .nav-link {
  border: none;
  border-radius: var(--border-radius);
  color: var(--color-gray-600);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: var(--transition);
}

.courses-nav-tabs .nav-link:hover {
  background: var(--color-gray-100);
  color: var(--color-primary);
}

.courses-nav-tabs .nav-link.active {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow);
}

.course-card {
  transition: var(--transition);
  border: 1px solid var(--color-gray-200);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.course-card .card-header {
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.course-card .badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.course-details p {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.course-details i {
  width: 16px;
  text-align: center;
}

.filter-container {
  background: var(--color-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-title {
  color: var(--color-gray-700);
  font-weight: 600;
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ===== CALENDAR STYLES ===== */
.calendar-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.fc {
  font-family: var(--font-secondary);
}

.fc-toolbar {
  margin-bottom: 1.5rem;
}

.fc-toolbar-title {
  color: var(--color-primary);
  font-weight: 600;
}

.fc-button-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.fc-button-primary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.fc-event {
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.fc-event:hover {
  opacity: 0.8;
}

.fc-daygrid-event {
  padding: 2px 4px;
}

.calendar-tooltip {
  background: var(--color-dark) !important;
  color: white !important;
  padding: 8px 12px !important;
  border-radius: var(--border-radius) !important;
  font-size: 0.75rem !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 1000 !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .courses-nav-tabs {
    padding: 0.25rem;
  }
  
  .courses-nav-tabs .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .filter-buttons {
    flex-direction: column;
  }
  
  .filter-buttons .dropdown,
  .filter-buttons button {
    width: 100%;
  }
  
  .course-card {
    height: auto !important;
    min-height: auto !important;
  }
  
  .course-card .card-body {
    padding: 1rem;
    overflow: visible !important;
    height: auto !important;
  }
  
  .course-details {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }
  
  .course-details p {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.85rem;
  }
  
  .calendar-container {
    padding: 1rem;
  }
}

/* ===== TIMELINE STYLES ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-gray-300);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item-last .timeline-content::after {
  display: none;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  box-shadow: var(--shadow);
  z-index: 1;
}

.timeline-content {
  background: white;
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-gray-300);
  margin-left: 1rem;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-weight: 600;
  color: var(--color-dark);
  margin: 0;
  font-size: 1rem;
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  white-space: nowrap;
  margin-left: 1rem;
}

.timeline-description {
  color: var(--color-gray-600);
  margin: 0;
  line-height: 1.5;
}

/* Timeline marker colors */
.timeline-marker.bg-success {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.timeline-marker.bg-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.timeline-marker.bg-warning {
  background-color: var(--color-warning);
  border-color: var(--color-warning);
}

.timeline-marker.bg-info {
  background-color: var(--color-info);
  border-color: var(--color-info);
}

.timeline-marker.bg-danger {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

.timeline-marker.bg-secondary {
  background-color: var(--color-gray-500);
  border-color: var(--color-gray-500);
}

/* Timeline content border colors */
.timeline-item:has(.timeline-marker.bg-success) .timeline-content {
  border-left-color: var(--color-success);
}

.timeline-item:has(.timeline-marker.bg-primary) .timeline-content {
  border-left-color: var(--color-primary);
}

.timeline-item:has(.timeline-marker.bg-warning) .timeline-content {
  border-left-color: var(--color-warning);
}

.timeline-item:has(.timeline-marker.bg-info) .timeline-content {
  border-left-color: var(--color-info);
}

.timeline-item:has(.timeline-marker.bg-danger) .timeline-content {
  border-left-color: var(--color-danger);
}

.timeline-item:has(.timeline-marker.bg-secondary) .timeline-content {
  border-left-color: var(--color-gray-500);
}

.modal-content {
  pointer-events: auto !important;
  z-index: 1060 !important;
}

.modal input,
.modal select,
.modal textarea,
.modal button {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* ===== ROLES ASSIGNMENT STYLES ===== */
.roles-checkbox-container {
  border: 1px solid var(--color-gray-300);
  border-radius: var(--border-radius);
  padding: 1rem;
  background-color: var(--color-light);
  max-height: 200px;
  overflow-y: auto;
}

.role-checkbox-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.role-checkbox-item:last-child {
  border-bottom: none;
}

.role-checkbox-item input[type="checkbox"] {
  margin-right: 0.75rem;
  transform: scale(1.2);
  cursor: pointer;
}

.role-checkbox-item label {
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  flex: 1;
}

.role-checkbox-item.last-role {
  opacity: 0.7;
}

.role-checkbox-item.last-role label {
  color: var(--color-gray-500);
  font-style: italic;
}

.role-checkbox-item.last-role label::after {
  content: " (último rol - no se puede desmarcar)";
  font-size: 0.8rem;
  color: var(--color-warning);
}

/* ===== COURSE REQUEST FORM STYLES ===== */
.course-request-section {
  border: 1px solid var(--color-gray-200);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.course-request-section:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.section-header h5 {
  font-family: var(--font-primary);
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.solicitor-info {
  background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-light) 100%);
  border-left: 4px solid var(--color-primary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.exposition-text {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border-left: 4px solid var(--color-info);
  font-style: italic;
  color: var(--color-gray-700);
}

.upload-area {
  background: linear-gradient(135deg, #fefce8 0%, #fffbeb 100%);
  transition: var(--transition);
  cursor: pointer;
}

.upload-area:hover {
  background: linear-gradient(135deg, #fef3c7 0%, #fef7cd 100%);
  border-color: var(--color-accent) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.upload-area i {
  transition: var(--transition);
}

.upload-area:hover i {
  transform: scale(1.1);
  color: var(--color-accent) !important;
}

#selectedFiles {
  background: var(--color-gray-100);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: white;
  border-radius: var(--border-radius);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-info {
  display: flex;
  align-items: center;
}

.file-info i {
  margin-right: 0.5rem;
  color: var(--color-primary);
}

.file-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition);
}

.file-remove:hover {
  background: var(--color-danger);
  color: white;
}

.form-check-input:checked {
  background-color: var(--color-success);
  border-color: var(--color-success);
}

.form-check-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.25);
}

.modal-xl .modal-content {
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header.bg-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%) !important;
}

.modal-footer.bg-light {
  background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-light) 100%) !important;
  border-top: 1px solid var(--color-gray-200);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.25rem rgba(44, 90, 160, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.text-warning {
  color: var(--color-warning) !important;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fef7cd 100%);
  border: 1px solid var(--color-warning);
  border-left: 4px solid var(--color-warning);
  color: var(--color-gray-800);
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-secondary);
  line-height: 1.6;
  color: var(--color-gray-800);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-padding {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 1rem;
  position: relative;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-gray-600);
  max-width: 600px;
  margin: 0 auto 3rem;
}

.section-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.bg-light-gradient {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* ===== HEADER & NAVIGATION ===== */
#header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  z-index: 1000;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-brand img {
  transition: var(--transition);
}

.navbar-nav .nav-link {
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--color-gray-700);
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--color-primary);
  background-color: rgba(44, 90, 160, 0.1);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  width: 80%;
}

/* ===== HERO SECTION ===== */
.hero-section {
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero-section .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(44, 90, 160, 0.8), rgba(30, 58, 138, 0.6));
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-section h2 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-section .lead {
  font-size: 1.25rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.hero-img img {
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  transition: transform 0.3s ease;
}

.hero-img img:hover {
  transform: scale(1.05);
}

/* ===== BUTTONS ===== */
.btn {
  font-family: var(--font-primary);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-outline-primary {
  color: #007bff;
  border-color: #007bff;
  background-color: #f8f9fa;
}

.btn-outline-primary:hover {
  color: white;
  background-color: #007bff;
  border-color: #007bff;
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  background-color: #f8f9fa;
}

.btn-outline-secondary:hover {
  color: white;
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-outline-light {
  border: 2px solid white;
  color: white;
  background: transparent;
}

.btn-outline-light:hover {
  background: white;
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-outline-secondary {
  border: 2px solid var(--color-gray-400);
  color: var(--color-gray-600);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--color-gray-400);
  color: white;
}

/* ===== PRESENTATION SECTION ===== */
.presentation-section {
  position: relative;
  overflow: hidden;
}

.presentation-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23e2e8f0" opacity="0.3"/><circle cx="75" cy="75" r="1" fill="%23cbd5e1" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.5;
}

.section-header-wrapper {
  position: relative;
  z-index: 2;
}

.presentation-content {
  position: relative;
  z-index: 2;
}

/* ===== OFERTA FORMATIVA SECTION ===== */
.oferta-formativa-section {
  background: white;
}

.filter-container {
  background: var(--color-light);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

.filter-title {
  color: var(--color-dark);
  font-weight: 600;
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.dropdown-toggle {
  min-width: 150px;
}

/* Dropdowns en navbar sin min-width fijo */
.navbar-nav > .nav-item.dropdown > .dropdown-toggle {
  min-width: auto;
}

.courses-container {
  min-height: 400px;
}

.course-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.course-card .card-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  padding: 1.5rem;
  border: none;
}

.course-card .card-body {
  padding: 1.5rem;
}

.course-badge {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* ===== INSCRIPTION SECTION ===== */
.inscription-section {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Timeline Styles */
.inscription-timeline {
  position: relative;
  padding: 1rem 0;
}

.inscription-timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
  border-radius: 3px;
}

.timeline-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.timeline-number {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
  border: 4px solid white;
}

.timeline-icon {
  display: none;
}

.timeline-content {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
  flex: 1;
  transition: var(--transition);
  border-left: 4px solid var(--color-primary);
}

.timeline-content:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-lg);
}

.timeline-content h4 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.timeline-content p {
  color: var(--color-gray-600);
  margin: 0;
  line-height: 1.6;
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.badge-item {
  font-size: 0.85rem;
  color: var(--color-gray-600);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .inscription-timeline::before {
    left: 20px;
  }
  
  .timeline-number {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
  
  .timeline-content {
    padding: 1rem;
  }
  
  .timeline-content h4 {
    font-size: 1rem;
  }
  
  .badges-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-item {
    gap: 1rem;
  }
}

/* ===== NORMATIVA SECTION ===== */
.normativa-section {
  background: white;
}

.normativa-image-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
}

.normativa-image-container img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.download-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: var(--transition);
}

.normativa-image-container:hover .download-overlay {
  opacity: 1;
}

.normativa-image-container:hover img {
  filter: brightness(0.7);
}

.normativa-content-container {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

.accordion-button {
  font-family: var(--font-primary);
  font-weight: 600;
  color: var(--color-dark);
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
}

/* ===== CALENDAR SECTION ===== */
.calendar-section {
  background: var(--color-light);
}

.calendar-wrapper {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.current-month {
  color: var(--color-dark);
  margin: 0;
  font-weight: 700;
}

.calendar-container {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-gray-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: white;
  border-radius: 50px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.legend-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-gray-300);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid white;
  outline: 1px solid var(--color-gray-300);
}

.legend-text {
  font-size: 0.875rem;
  color: var(--color-gray-700);
  font-weight: 500;
  white-space: nowrap;
}

/* ===== ENLACES SECTION ===== */
.enlaces-section {
  background: white;
}

.enlaces-intro {
  background: var(--color-light);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

.link-card {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.link-card .card-body {
  padding: 2rem;
  text-align: center;
}

.link-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 1.5rem;
}

/* ===== CONTACTO SECTION ===== */
.contacto-section {
  background: var(--color-light);
}

.contact-info-container,
.contact-form-container {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

.contact-header {
  text-align: center;
  border-bottom: 1px solid var(--color-gray-200);
  padding-bottom: 1.5rem;
}

.contact-icon-header {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: white;
  font-size: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.contact-text h5 {
  color: var(--color-dark);
  margin-bottom: 0.25rem;
}

.contact-text p {
  color: var(--color-gray-600);
  margin: 0;
}

.form-floating > .form-control,
.form-floating > .form-select {
  border: 2px solid var(--color-gray-200);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* ===== FOOTER ===== */
.footer {
  background: linear-gradient(135deg, var(--color-dark), var(--color-gray-800));
  color: white;
}

.footer-top {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links ul li {
  margin-bottom: 0.75rem;
}

.footer-links ul li a {
  color: var(--color-gray-300);
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.footer-links ul li a:hover {
  color: white;
  transform: translateX(5px);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.footer-newsletter .input-group {
  margin-top: 1rem;
}

.footer-newsletter .form-control {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.footer-newsletter .form-control::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.footer-bottom-links a {
  color: var(--color-gray-300);
  text-decoration: none;
  transition: var(--transition);
}

.footer-bottom-links a:hover {
  color: white;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  color: white;
}

/* ===== MODAL STYLES ===== */
.modal-content {
  border-radius: var(--border-radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header .btn-close {
  filter: invert(1);
}

/* ===== HERO BUTTONS ===== */
.hero-login-btn, .hero-dashboard-btn {
  animation: pulse 2s infinite;
  white-space: nowrap;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
  }
}

.hero-dashboard-btn {
  animation-name: pulse-orange;
}

@keyframes pulse-orange {
  0%, 100% {
    box-shadow: 0 8px 20px rgba(247, 183, 51, 0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(247, 183, 51, 0.6);
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: 4rem 0 3rem;
    padding-top: 80px;
  }
  
  .hero-section h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-section h2 {
    font-size: 1.25rem;
  }
  
  .hero-section .lead {
    font-size: 1rem;
  }
  
  .hero-img-mobile {
    margin-top: 1rem;
  }
  
  .hero-img-mobile img {
    max-height: 120px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.3));
  }
  
  .hero-login-btn, .hero-dashboard-btn {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  #heroButtons {
    width: 100%;
    padding: 0 1rem;
  }
  
  #heroButtons .btn-lg {
    width: 100%;
    text-align: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .section-padding {
    padding: 3rem 0;
  }
  
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .calendar-nav {
    justify-content: space-between;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .footer-bottom-links {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-login-btn, .hero-dashboard-btn {
    font-size: 1.1rem !important;
    padding: 1rem 1.5rem !important;
  }
  
  .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }
  
  .section-badge {
    font-size: 0.75rem;
    padding: 0.375rem 1rem;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== FOCUS STYLES ===== */
.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .navbar,
  .back-to-top,
  .social-links {
    display: none !important;
  }
  
  .hero-section {
    background: none !important;
    color: black !important;
  }
  
  .hero-section .overlay {
    display: none;
  }
}

/* ===== ESTILOS PARA NAVEGACIÓN INTELIGENTE DE CURSOS ===== */

/* Estilos para resaltado de botones y navegación inteligente */
.btn-highlight-pulse {
    animation: highlightPulse 2s infinite;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.6) !important;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
    }
    50% {
        box-shadow: 0 0 30px rgba(40, 167, 69, 0.9);
    }
    100% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
    }
}

/* Tooltip de resaltado */
.highlight-tooltip {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: tooltipBounce 0.5s ease-out;
    max-width: 200px;
    text-align: center;
}

.highlight-tooltip .tooltip-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes tooltipBounce {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Estilos para alertas de navegación */
.alert.border-0 {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-success.border-0 {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid #28a745;
}

.alert-warning.border-0 {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid #ffc107;
}

.alert-info.border-0 {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border-left: 4px solid #17a2b8;
}

/* Animación para modal de detalles */
#courseDetailsGuidanceModal .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FILE UPLOAD STYLES ===== */
.upload-area {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px dashed var(--color-primary) !important;
    background-color: var(--color-light);
}

.upload-area:hover {
    background-color: var(--color-gray-100);
    border-color: var(--color-secondary) !important;
}

.upload-area.drag-over {
    background-color: rgba(44, 90, 160, 0.1);
    border-color: var(--color-secondary) !important;
    transform: scale(1.02);
}

.selected-file {
    background-color: var(--color-gray-100);
    border: 1px solid var(--color-gray-300) !important;
    transition: all 0.2s ease;
}

.selected-file:hover {
    background-color: var(--color-gray-200);
    border-color: var(--color-primary) !important;
}

.file-name {
    color: var(--color-dark);
    font-size: 0.9rem;
}

.file-size {
    color: var(--color-gray-500);
    font-size: 0.8rem;
}

.btn-outline-danger:hover {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: white;
}

/* File upload animations */
@keyframes fileAdded {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-file {
    animation: fileAdded 0.3s ease-out;
}

/* ===== DASHBOARD AULA VIRTUAL STYLES ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid #e1e8ed;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.dashboard-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.2rem;
}

.dashboard-card .card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.dashboard-card .card-content {
    padding: 1.5rem;
}

/* Estilo especial para la tarjeta de Aula Virtual */
.card-highlight-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.card-highlight-content::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20%, -20%); }
}

.card-highlight-content p {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.btn-aula-virtual {
    background: white !important;
    color: #667eea !important;
    font-weight: 600;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    text-decoration: none;
    display: inline-block;
}

.btn-aula-virtual:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #764ba2 !important;
    text-decoration: none;
}

/* ===== SYSTEM CONFIGURATION MODAL ===== */
.system-config-list {
    padding: 1rem;
}

.config-category {
    margin-bottom: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.config-category .category-title {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.config-category .table {
    margin-bottom: 0;
}

.config-category .table thead {
    background-color: var(--color-gray-100);
}

.config-category .table thead th {
    font-weight: 600;
    color: var(--color-gray-700);
    border-bottom: 2px solid var(--color-gray-300);
    padding: 0.75rem;
}

.config-category .table tbody tr:hover {
    background-color: var(--color-gray-50);
}

.config-category .table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.config-category .table tbody td strong {
    color: var(--color-gray-800);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.config-category .table tbody td code {
    background-color: var(--color-gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--color-gray-800);
}

.config-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.config-filters .btn {
    transition: var(--transition);
}

.config-filters .btn.active {
    box-shadow: var(--shadow-md);
}
