/* Custom CSS Variables */
:root {
    --primary-color: #003c58;
    --secondary-color: #17a2b8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 80px;
    height: 60px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 11px;
    border-radius: 4px;
    text-align: center;
}

.logo1 {
    width: 90px;
    height: 60px;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 11px;
    border-radius: 4px;
    text-align: center;
}

.logo-text {
    line-height: 1.2;
}

.logo-text small {
    font-size: 9px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 4px;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

/* Main Content */
.main-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Downloads Section */
.downloads-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.section-header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.section-title {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 300;
}

.section-description {
    font-size: 16px;
    opacity: 0.9;
}

/* Version Selector */
.version-selector {
    padding: 25px;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.version-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

/* Collapsible Sections */
.collapsible-section {
    border-bottom: 1px solid var(--border-color);
}

.collapsible-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.collapsible-header:hover {
    background-color: #138496;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.collapsible-header.active {
    background-color: #138496;
}

.collapsible-title {
    font-size: 18px;
    font-weight: 600;
}

.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 16px;
}

.collapsible-header.active .collapse-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: white;
}

.collapsible-content.active {
    max-height: 1000px;
}

/* Files Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 25px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.file-container {
    gap: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.file-icon {
    width: 40px;
    height: 40px;
    background-color: var(--success-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 8px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 5px;
    word-wrap: break-word;
}

.file-size {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.file-description {
    font-size: 14px;
    color: var(--text-muted);
}

.file-description-box {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
    white-space: pre-wrap;
}

.caso-description-box {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    font-weight: bold;
    color: #495057;
    line-height: 1.4;
    white-space: pre-wrap;
}

.download-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-download {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background-color: #16404a;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-play {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}

.btn-preview {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}

.btn-play:hover {
    background-color: #218838;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-preview:hover {
    background-color: #138496;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Video Player Modal */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-player.loading {
    background: #000 url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iMjAiIGN5PSIyMCIgcj0iMTgiIHN0cm9rZT0iIzMzMzMzMyIgc3Ryb2tlLXdpZHRoPSI0Ii8+CjxwYXRoIGQ9Ik0yMCAyQTE4IDE4IDAgMCAxIDM4IDIwIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+CjxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZTpicm90YXRlIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgdmFsdWVzPSIwIDIwIDIwOzM2MCAyMCAyMCIvPgo8L3N2Zz4K') no-repeat center center;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-play-overlay i {
    font-size: 4rem;
    color: white;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.video-play-overlay:hover i {
    transform: scale(1.1);
}

.video-play-overlay span {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
}

.video-info {
    flex: 1;
    text-align: left;
}

#videoPlayerModal .modal-dialog {
    max-width: 800px;
}

#videoPlayerModal .modal-body {
    padding: 0;
}

#videoPlayerModal .modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Image Preview Modal */
.image-container {
    position: relative;
    width: 100%;
    text-align: center;
    background-color: #f8f9fa;
    padding: 20px;
}

.image-preview {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.image-info {
    flex: 1;
    text-align: left;
}

#imagePreviewModal .modal-dialog {
    max-width: 800px;
}

#imagePreviewModal .modal-body {
    padding: 0;
}

#imagePreviewModal .modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Validation Section */
.validation-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.validation-form-container {
    padding: 30px;
    background-color: white;
}

.validation-form {
    background-color: var(--light-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.validation-info {
    padding: 30px;
    background-color: #f8f9fa;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: 100%;
}

.info-card h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.info-card ul {
    margin: 0;
    padding-left: 20px;
}

.info-card li {
    margin-bottom: 8px;
    color: #555;
}

/* Help Section */
.help-section {
    padding: 25px;
    background-color: var(--light-color);
}

/* Problem Report Styles */
.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    font-weight: 500;
}

.btn-warning:hover {
    background-color: #ffca2c;
    border-color: #ffc720;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

#problemReportModal .modal-header {

    background-color: #fff3cd;
    border-bottom: 1px solid #ffeaa7;
}

#problemReportModal .modal-title {
    color: #856404;
    font-weight: 600;
}

#problemReportModal .alert-info {
    background-color: #e7f3ff;
    border-color: #bee5eb;
    color: #0c5460;
}

#problemReportModal .form-label .text-danger {
    font-size: 0.9em;
}

#problemReportModal .form-check-label {
    font-weight: 500;
}

.d-flex.gap-2 {
    gap: 0.5rem !important;
}

@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }

    .d-flex.gap-2 .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Clickable table rows */
.table tbody tr[style*="cursor: pointer;"]:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
    transform: scale(1.001);
    transition: all 0.2s ease;
}

.table tbody tr[style*="cursor: pointer;"].table-warning:hover {
    background-color: rgba(255, 193, 7, 0.3) !important;
}

/* Problem detail modal improvements */
#problemDetailModal .modal-dialog {
    max-width: 800px;
}

#problemDetailModal .form-label.fw-bold {
    color: var(--primary-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

#problemDetailModal .alert-light {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
}

#problemDetailModal code {
    background-color: #f1f3f4;
    color: #d63384;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

#problemDetailModal .badge {
    font-size: 0.8em;
    padding: 0.4em 0.8em;
}

/* Action buttons in modal footer */
#problemActionButtons .btn {
    transition: all 0.3s ease;
}

#problemActionButtons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Loading spinner improvements */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Attachment link styling */
#problemDetailModal a[href*="download_problem_attachment"] {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

#problemDetailModal a[href*="download_problem_attachment"]:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Admin Styles */
.admin-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    color: var(--primary-color);
    font-weight: 300;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.admin-nav .btn {
    transition: all 0.3s ease;
}

.admin-nav .btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Admin Login */
.admin-login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* User Management Styles */
.user-table {
    font-size: 0.9rem;
}

.user-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.user-table .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease;
}

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

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stat-card .card-title {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.badge {
    font-size: 0.75rem;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Stat Cards */
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

.stat-info p {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: white;
}

.footer-section p,
.footer-section a {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #333;
    color: #999;
    font-size: 13px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        display: none;
    }

    .files-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .file-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .admin-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .main-container,
    .admin-container {
        padding: 0 15px;
    }

    .section-header,
    .validation-form-container {
        padding: 20px;
    }

    .login-card {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* Custom Bootstrap Overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #16404a;
    border-color: #16404a;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

.alert {
    border: none;
    border-radius: 8px;
}

.card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-radius: 10px;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: var(--light-color);
    border-top: none;
    font-weight: 600;
    color: var(--primary-color);
}

.badge {
    font-size: 12px;
    padding: 6px 10px;
}

/* Flash messages */
.alert {
    margin-bottom: 1rem;
}

/* Validation Results List */
.validation-results-list {
    animation: fadeIn 0.3s ease-in;
}

.validation-result-item {
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.validation-result-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.validation-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}