/* Custom CSS for Adquisiciones Module */

/* Navigation Bar Fix - Better Contrast */
#header {
    background: rgba(0, 123, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

#header .navbar {
    background: transparent !important;
}

#header .navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#header .navbar-nav .nav-link:hover {
    color: #e3f2fd !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

#header .navbar-nav .dropdown-menu {
    background: rgba(0, 123, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

#header .navbar-nav .dropdown-item {
    color: #ffffff !important;
}

#header .navbar-nav .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e3f2fd !important;
}

/* Logo and Header Text */
#header h1 a {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Year Grid Layout */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

/* Year Links Styling */
.year-link {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 15px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 123, 255, 0.2);
    border: 2px solid rgba(0, 123, 255, 0.4);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.year-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.4);
    border-color: #ffffff;
    background: rgba(0, 123, 255, 0.3);
}

.year-link:hover .year-text {
    background: rgba(0, 0, 0, 0.6);
    border-color: #ffffff;
    transform: scale(1.05);
}

.year-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../../img/ejercicios/year.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8;
    z-index: 1;
}

.year-text {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Classification structure styling */
.classification-group {
    background: rgba(0, 123, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid rgba(0, 123, 255, 0.3);
    max-height: 600px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.classification-group h3 {
    color: #fff;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    z-index: 10;
}

.subgroup {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(0, 123, 255, 0.2);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subgroup h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 123, 255, 0.8);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Responsive adjustments for classification structure */
@media (max-width: 768px) {
    .classification-group {
        padding: 15px;
        margin-bottom: 15px;
        max-height: 500px;
    }
    
    .subgroup {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .subgroup h4 {
        font-size: 1rem;
    }
    
    .year-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
        max-height: 300px;
    }
    
    .year-link {
        height: 100px;
    }
    
    .year-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .year-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .year-link {
        height: 80px;
    }
    
    .year-text {
        font-size: 1rem;
    }
}

/* Custom scrollbar styling */
.classification-group::-webkit-scrollbar,
.year-grid::-webkit-scrollbar {
    width: 8px;
}

.classification-group::-webkit-scrollbar-track,
.year-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.classification-group::-webkit-scrollbar-thumb,
.year-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.classification-group::-webkit-scrollbar-thumb:hover,
.year-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.calendar.imagen {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.year-link:hover .calendar.imagen {
    filter: brightness(1.1);
}

/* Modal Styling */
.modal-xl {
    max-width: 95%;
}

.modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-bottom: none;
}

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

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* DataTable Styling */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_length select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0 5px;
}

.dataTables_filter input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    margin-left: 8px;
}

.table thead th {
    background-color: #343a40;
    color: white;
    border: none;
    font-weight: 600;
    text-align: center;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.table tbody tr:hover {
    background-color: #e9ecef;
}

.table td {
    vertical-align: middle;
    border: 1px solid #dee2e6;
}

/* PDF Icon Styling */
.fa-file-pdf {
    transition: transform 0.2s ease;
}

.fa-file-pdf:hover {
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 100%;
        margin: 10px;
    }
    
    .year-link {
        margin-bottom: 15px;
    }
    
    .calendar.imagen {
        max-width: 80px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .calendar.imagen {
        max-width: 60px;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .dataTables_length,
    .dataTables_filter {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Background */
.bg-custom {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Section Styling */
section {
    position: relative;
}

section.bg-light {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px);
}

/* Hero Section */
#hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

#hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

/* Pagination Styling */
.dataTables_paginate .paginate_button {
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.dataTables_paginate .paginate_button.current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Styling */
.dataTables_info {
    padding: 10px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Table Responsive */
.table-responsive {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

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

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
