/* Custom Styles for Cursos UTO - Rediseño Estético */

/* 1. Reset & Global Background */
html, body {
    height: 100%;
    margin: 0;
}

body {
    background-color: #f4f6f9 !important; /* Soft cool blue-gray background to balance color */
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #334155;
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: transparent !important;
}

#content {
    flex: 1 0 auto;
}

/* 2. Premium Navbar (Header) */
.navbar-custom {
    background: linear-gradient(135deg, #1a3c6d 0%, #0f2b54 100%);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid #f59e0b; /* Accent golden yellow line from UTO colors */
    min-height: 70px;
    z-index: 1030;
}

.navbar-brand-custom {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    gap: 0.75rem;
}

.navbar-brand-custom img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.navbar-brand-custom:hover img {
    transform: scale(1.05);
}

.brand-text-wrapper {
    display: flex;
    flex-column: column;
    justify-content: center;
}

.brand-title {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1px;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0px 2px 4px rgba(0,0,0,0.3);
}

.brand-subtitle {
    color: #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

.course-title-header {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 600;
    max-width: 50%;
    text-align: right;
    line-height: 1.3;
    margin: 0;
    color: #e2e8f0;
}

/* 3. Cards Redesign */
.card {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 25px rgba(26, 60, 109, 0.05) !important;
    overflow: hidden;
    margin-bottom: 2rem;
    background: #ffffff;
}

.card-header-custom {
    background: linear-gradient(135deg, #1a3c6d 0%, #244c84 100%) !important;
    padding: 1.25rem 1.5rem !important;
    border-bottom: none !important;
}

.card-header-custom h6 {
    color: #ffffff !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    margin: 0;
}

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

/* 4. Search Form Improvements */
.search-form-container {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.search-input-group input[type="text"] {
    flex: 1;
    min-width: 200px;
    border: 2px solid #cbd5e1;
    border-radius: 30px;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.3s ease;
    outline: none;
}

.search-input-group input[type="text"]:focus {
    border-color: #1a3c6d;
    box-shadow: 0 0 0 3px rgba(26, 60, 109, 0.15);
}

.btn-search-custom {
    background-color: #1a3c6d !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 0.6rem 1.75rem !important;
    border-radius: 30px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(26, 60, 109, 0.15) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-search-custom:hover {
    background-color: #244c84 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(26, 60, 109, 0.25) !important;
}

/* 5. Custom Table Layout & Color Alternation */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.table {
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
}

.table th {
    background-color: #1a3c6d !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1.1rem 1rem !important;
    border: none !important;
    text-align: center;
    vertical-align: middle !important;
}

.table td {
    padding: 1.1rem 1rem !important;
    vertical-align: middle !important;
    border-color: #e2e8f0 !important;
    font-size: 0.95rem;
    color: #334155;
}

/* Alternating rows using soft blue */
.table tbody tr:nth-of-type(odd) {
    background-color: rgba(26, 60, 109, 0.03) !important;
}

.table tbody tr:nth-of-type(even) {
    background-color: #ffffff !important;
}

.table tbody tr:hover {
    background-color: rgba(26, 60, 109, 0.07) !important;
    transition: background-color 0.2s ease;
}

/* 6. Modern Status Badges */
.badge-status {
    display: inline-block;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    text-align: center;
}

.badge-status-paid {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-status-unpaid {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Academic status badges */
.badge-academic {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 50px;
    text-align: center;
    margin-top: 0.35rem;
    margin-right: 0.25rem;
    border: 1px solid transparent;
}

.badge-academic-aprobacion {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.badge-academic-participacion {
    background-color: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

.badge-academic-none {
    background-color: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* 7. Action Button Enhancements & Micro-animations */
.btn-download-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700 !important;
    padding: 0.5rem 1.2rem !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    transition: all 0.2s ease-in-out !important;
    width: auto;
    margin-bottom: 0.5rem;
    border: none !important;
    white-space: nowrap;
}

.btn-download-aprobacion {
    background-color: #10b981 !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.15) !important;
}

.btn-download-aprobacion:hover {
    background-color: #059669 !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.25) !important;
}

.btn-download-participacion {
    background-color: #0ea5e9 !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(14, 165, 233, 0.15) !important;
}

.btn-download-participacion:hover {
    background-color: #0284c7 !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(14, 165, 233, 0.25) !important;
}

.observations-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #475569;
}

/* 8. Footer Accent */
.footer-custom {
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    margin-top: auto; /* Push footer to the bottom of the container */
    flex-shrink: 0;
}

.footer-custom span {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 9. Responsive Adjustments */
@media (max-width: 991.98px) {
    .course-title-header {
        max-width: 60%;
        font-size: 0.95rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-custom {
        padding: 0.5rem 1rem;
    }
    .course-title-header {
        display: none; /* Hide long title from header on mobile, it will be in the content body */
    }
    .brand-title {
        font-size: 1.1rem;
    }
    .brand-subtitle {
        font-size: 0.65rem;
    }
    .card-body {
        padding: 1.25rem !important;
    }
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input-group input[type="text"] {
        width: 100%;
    }
    .btn-search-custom {
        width: 100%;
    }
    .btn-download-custom {
        width: 100% !important;
        display: flex !important;
    }
}

/* 10. Help Alert & Student Info Grid Styles */
.alert-help-custom {
    background-color: #e0f2fe !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 1.25rem 1.5rem !important;
    color: #0369a1 !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.05) !important;
}

.student-data-grid {
    margin-top: 1.5rem;
}

.info-block {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.info-block:hover {
    box-shadow: 0 6px 15px rgba(26, 60, 109, 0.07);
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.info-label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.info-value {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
}

.btn-download-pill {
    border-radius: 30px !important;
    padding: 0.7rem 1.75rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    border: none !important;
    font-size: 0.88rem !important;
    transition: all 0.25s ease-in-out !important;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.btn-download-pill-aprobacion {
    background-color: #10b981 !important;
    color: white !important;
}

.btn-download-pill-aprobacion:hover {
    background-color: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3) !important;
}

.btn-download-pill-participacion {
    background-color: #0ea5e9 !important;
    color: white !important;
}

.btn-download-pill-participacion:hover {
    background-color: #0284c7 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(14, 165, 233, 0.3) !important;
}

@media (max-width: 767.98px) {
    .btn-download-pill {
        width: 100% !important;
        margin-bottom: 0.75rem;
    }
}

.btn-download-pill.disabled,
.btn-download-pill:disabled {
    background-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    border: 1px solid #cbd5e1 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.65;
}

/* 11. Custom Course Visuals & Placeholders */
.images-container {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(26, 60, 109, 0.03);
}

.image-wrapper {
    width: 100%;
}

.image-placeholder-svg {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
}

.image-placeholder-svg:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 60, 109, 0.12);
    border-color: #cbd5e1;
}

/* 12. Floating Help Button & Interactive Popover */
.btn-help-floating {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: #ffffff;
    border: none;
    outline: none !important;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    z-index: 1050;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-help-floating:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.btn-help-floating:active {
    transform: scale(0.95);
}

.help-popup-card {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 320px;
    background-color: #ffffff;
    border: 1px solid #bae6fd;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    z-index: 1040;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.help-popup-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.help-popup-header {
    background-color: #f0f9ff;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #bae6fd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-popup-header h5 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0369a1;
    margin: 0;
}

.help-popup-header .close-help-popup {
    background: none;
    border: none;
    color: #0284c7;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    outline: none !important;
}

.help-popup-header .close-help-popup:hover {
    color: #0369a1;
}

.help-popup-body {
    padding: 1.25rem;
}

.help-popup-body p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #475569;
}

@media (max-width: 575.98px) {
    .help-popup-card {
        width: calc(100% - 30px);
        right: 15px;
        bottom: 85px;
    }
    .btn-help-floating {
        right: 15px;
        bottom: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* 13. Admin Login & Certificate Preview Protection */
.admin-login-link {
    opacity: 0.5;
    transition: all 0.25s ease-in-out;
}
.admin-login-link:hover {
    opacity: 1 !important;
    color: #f59e0b !important;
    transform: scale(1.1);
}

.certificate-preview-crop {
    position: relative;
    width: 100%;
    padding-bottom: 53%; /* 70.7% aspect ratio * 75% height = 53% to hide bottom 25% */
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #f8fafc;
}
.certificate-preview-crop:hover {
    transform: translateY(-2.5px);
    box-shadow: 0 8px 20px rgba(26, 60, 109, 0.12);
    border-color: #cbd5e1;
}
.certificate-preview-crop img,
.certificate-preview-crop svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
