/* Agenda - CSS Mínimo */

/* Título */
.title-section {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #718096;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

/* Tarjeta */
.service-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 260px;
}

.service-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Header */
.card-header-custom {
    padding: 1rem;
    background: #f7fafc;
    border-bottom: 2px solid var(--primary, #00b4a5);
    min-height: 140px;
    max-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-type {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary, #00b4a5);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.service-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
}

.service-title:hover::after {
    content: attr(data-full-title);
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 100;
    white-space: normal;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.service-project {
    font-size: 0.75rem;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Info */
.service-info {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #2d3748;
}

.info-item i {
    color: var(--primary, #00b4a5);
    width: 16px;
    font-size: 0.85rem;
}

/* Footer */
.card-footer-custom {
    padding: 0.5rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    margin-top: auto;
}

.btn-read-more {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: transparent;
    color: var(--primary, #00b4a5);
    border: 2px solid var(--primary, #00b4a5);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
}

.btn-read-more:hover {
    background: var(--primary, #00b4a5);
    color: white;
}

/* Badge */
.badge-online {
    background: #ff6b35;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Modal */
.modal-header {
    background: white;
    color: #2d3748;
    border-bottom: none;
    padding: 1.5rem 2rem;
}

.modal-header-content {
    flex: 1;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.modal-subtitle {
    font-size: 1rem;
    color: #718096;
}

.modal-header .btn-close {
    filter: none;
}

.modal-body {
    padding: 2rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h6 {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-section img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.detail-section .btn-primary {
    background: var(--primary, #00b4a5);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 4px;
}

.detail-section .btn-primary:hover {
    background: #009688;
}

.detail-section iframe {
    border-radius: 8px;
    margin-top: 0.5rem;
}

.schedule-list {
    list-style: none;
    padding: 0;
}

.schedule-list li {
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary, #00b4a5);
}

/* Empty */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3rem;
    color: #718096;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page-title { font-size: 2rem; }
    .services-grid { grid-template-columns: 1fr; }
    .service-card { height: auto; min-height: 260px; }
    
    /* Modal adaptativo en móvil */
    .modal-body .row.g-4 > [class*="col-md-"] {
        margin-bottom: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1400px) {
    .services-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ====================================
   MODAL IMPROVEMENTS - Two Column Layout
   ==================================== */

.modal-xl {
    max-width: 1140px;
}

.schedule-item {
    transition: background-color 0.2s ease;
}

.schedule-item:hover {
    background-color: #e6f7f5 !important;
}

.schedule-item i {
    font-size: 0.9rem;
}

.alert-info {
    background-color: #e6f7f5;
    border-color: #00b4a5;
    color: #2d3748;
}

.alert-success {
    background-color: #e6f7f5;
    border-color: #00b4a5;
    color: #2d3748;
}

/* ====================================
   MODAL - DISEÑO COMPACTO 50/50
   ==================================== */

/* Modal XL for two column layout */
.modal-xl {
    max-width: 1100px;
}

.modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.modal-body {
    padding: 0;
}

/* Close button positioned at top right */
.modal-close-top {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-close-top:hover {
    background: white;
    transform: scale(1.1);
}

/* LEFT SECTION: Image (50%) */
.modal-image-section {
    min-height: 450px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    text-align: center;
    padding: 3rem;
}

/* RIGHT SECTION: Info (50%) */
.modal-info-section {
    background: white;
    display: flex;
    flex-direction: column;
}

.modal-info-section h3 {
    font-size: 1.5rem;
    color: #2d3748;
    line-height: 1.3;
}

.modal-info-section .badge {
    font-size: 0.75rem;
    padding: 0.4em 0.8em;
}

/* Compact spacing */
.modal-info-section p {
    margin-bottom: 0.5rem;
}

.modal-info-section h6 {
    font-size: 0.9rem;
    color: #4a5568;
    letter-spacing: 0.3px;
}

/* Registration and Location Row */
.modal-info-section .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Free message box - Fixed with asterisk */
.free-message-box {
    background: #f0f9f4 !important;
    border-radius: 6px;
}

.free-message-box p {
    color: #047857 !important;
    font-size: 0.9rem !important;
    line-height: 1.4;
}

.free-message-box span {
    color: #16a34a;
    font-weight: 900;
}

/* Free message alert */
.alert-success {
    border-left: 4px solid #28a745;
    background-color: #d4edda;
}

/* MAP SECTION: Full width below */
.modal-map-section {
    background: #f8f9fa;
}

.modal-map-section h6 {
    font-size: 0.95rem;
    color: #2d3748;
}

.service-location-map {
    width: 100%;
}

/* ====================================
   RESPONSIVE - MOBILE
   ==================================== */

@media (max-width: 768px) {
    .modal-xl {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    /* Stack columns */
    .modal-image-section {
        min-height: 250px;
        max-height: 250px;
    }
    
    .modal-info-section h3 {
        font-size: 1.25rem;
    }
    
    .modal-close-top {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }
    
    .service-location-map {
        height: 200px !important;
    }
}

/* ====================================
   LEAFLET MAP CUSTOMIZATION
   ==================================== */

.service-location-map {
    z-index: 1;
}

/* Custom marker styles for services */
.custom-service-marker {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-service-marker i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    font-family: inherit;
    font-size: 0.9rem;
}

/* Zoom controls positioning */
.leaflet-control-zoom {
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px;
    height: 36px;
    line-height: 36px;
}

/* Map loading state */
.service-location-map .alert {
    margin: 0;
    border-radius: 0.375rem;
}
