/* Custom styles for the support incident application - Prestige Auto Theme */

:root {
    --prestige-black: #000000;
    --prestige-dark-gray: #2c2c2c;
    --prestige-gray: #4a4a4a;
    --prestige-light-gray: #c4c4c4;
    --prestige-silver: #e8e8e8;
    --prestige-white: #ffffff;
    --prestige-accent: #007bff;
}

body {
    background-color: var(--prestige-silver);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--prestige-dark-gray);
}

.ticket-card {
    margin-bottom: 1rem;
    border-left: 4px solid var(--prestige-gray);
    background: linear-gradient(145deg, var(--prestige-white) 0%, #fafafa 100%);
}

.ticket-card.priority-baja {
    border-left-color: #28a745;
}

.ticket-card.priority-media {
    border-left-color: #ffc107;
}

.ticket-card.priority-alta {
    border-left-color: #fd7e14;
}

.ticket-card.priority-critica {
    border-left-color: #dc3545;
}

/* Prestige Auto Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--prestige-black) 0%, var(--prestige-dark-gray) 100%);
    border-color: var(--prestige-black);
    color: var(--prestige-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--prestige-dark-gray) 0%, var(--prestige-black) 100%);
    border-color: var(--prestige-dark-gray);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-outline-primary {
    border-color: var(--prestige-black);
    color: var(--prestige-black);
}

.btn-outline-primary:hover {
    background-color: var(--prestige-black);
    border-color: var(--prestige-black);
    color: var(--prestige-white);
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: var(--prestige-white);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--prestige-light-gray) 0%, var(--prestige-gray) 100%);
    border-color: var(--prestige-light-gray);
    color: var(--prestige-white);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--prestige-gray) 0%, var(--prestige-dark-gray) 100%);
    transform: translateY(-1px);
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.status-abierto {
    background-color: #007bff;
    color: white;
}

.status-enprogreso {
    background-color: #ffc107;
    color: black;
}

.status-resuelto {
    background-color: #28a745;
    color: white;
}

.status-cerrado {
    background-color: #6c757d;
    color: white;
}

.status-cancelado {
    background-color: #dc3545;
    color: white;
}

.priority-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.priority-baja {
    background-color: #d4edda;
    color: #155724;
}

.priority-media {
    background-color: #fff3cd;
    color: #856404;
}

.priority-alta {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-critica {
    background-color: #f5c6cb;
    color: #721c24;
    font-weight: bold;
}

.comment-internal {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.comment-external {
    background-color: #f3e5f5;
    border-left: 3px solid #9c27b0;
}

/* Prestige Auto Navbar */
.navbar-prestige {
    background: linear-gradient(135deg, var(--prestige-silver) 0%, var(--prestige-dark-gray) 100%);
    border-bottom: 3px solid var(--prestige-light-gray);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-height: 70px;
}

.navbar-brand {
    font-weight: bold;
    color: var(--prestige-black) !important;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.navbar-brand:hover {
    color: var(--prestige-light-gray) !important;
}

.navbar-prestige .navbar-text {
    color: var(--prestige-light-gray) !important;
    font-weight: 500;
}

.navbar-prestige .btn-outline-light {
    border-color: var(--prestige-light-gray);
    color: var(--prestige-light-gray);
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-prestige .btn-outline-light:hover {
    background-color: var(--prestige-white);
    color: var(--prestige-black);
    border-color: var(--prestige-white);
}

.prestige-logo {
    height: 35px;
    width: auto;
    margin-right: 12px;
    filter: brightness(1.1);
}

.card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background-color: var(--prestige-white);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Prestige Auto Sidebar */
.list-group-item-action {
    border: none;
    color: var(--prestige-dark-gray);
    font-weight: 500;
    transition: all 0.3s ease;
}

.list-group-item-action:hover {
    background: linear-gradient(135deg, var(--prestige-silver) 0%, #f0f0f0 100%);
    color: var(--prestige-black);
    transform: translateX(5px);
    border-radius: 8px;
}

.list-group-item-action.active {
    background: linear-gradient(135deg, var(--prestige-black) 0%, var(--prestige-dark-gray) 100%);
    color: var(--prestige-white);
    border-color: var(--prestige-black);
}

/* Form Controls */
.form-control, .form-select {
    border: 2px solid var(--prestige-light-gray);
    border-radius: 8px;
    padding: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--prestige-black);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--prestige-dark-gray);
    margin-bottom: 8px;
}

/* Estilo específico para combos de estado - ancho aumentado */
#filterStatus, select[data-field="estado"] {
    min-width: 150px;
}

/* Para los combos de estado en modales y formularios */
.status-select {
    min-width: 150px;
}

/* Card Headers */
.card-header {
    background: linear-gradient(135deg, var(--prestige-silver) 0%, #f5f5f5 100%);
    border-bottom: 2px solid var(--prestige-light-gray);
    font-weight: 600;
    color: var(--prestige-dark-gray);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table th {
    border-top: none;
    font-weight: 600;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

/* Loading spinner overlay */
.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    border-radius: 12px;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.loading-spinner .text-muted {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
}

/* Button loading states */
.btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login Page Styling */
#loginSection .card {
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#loginSection .card-header {
    background: linear-gradient(135deg, var(--prestige-white) 0%, var(--prestige-silver) 100%);
    border-bottom: 3px solid var(--prestige-light-gray);
    padding: 2rem 1.5rem 1.5rem;
}

#loginSection .card-body {
    padding: 2rem 1.5rem;
}

#loginSection .btn-primary {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Prestige Auto Branding */
.prestige-accent {
    color: var(--prestige-black);
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.text-prestige {
    color: var(--prestige-dark-gray);
}

.bg-prestige-light {
    background-color: var(--prestige-silver);
}

/* Estilos para la tabla de incidentes */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.table {
    margin-bottom: 0;
    background-color: var(--prestige-white);
}

.table thead th {
    background: linear-gradient(135deg, var(--prestige-silver) 0%, #f5f5f5 100%);
    border-bottom: 2px solid var(--prestige-light-gray);
    font-weight: 600;
    color: var(--prestige-dark-gray);
    font-size: 0.9rem;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.ticket-row {
    border-left: 4px solid transparent;
}

.priority-border-baja {
    border-left-color: #28a745;
}

.priority-border-media {
    border-left-color: #ffc107;
}

.priority-border-alta {
    border-left-color: #fd7e14;
}

.priority-border-critica {
    border-left-color: #dc3545;
}

.fs-7 {
    font-size: 0.8rem;
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: var(--prestige-white) !important;
    z-index: 1050;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: transparent;
    color: var(--prestige-dark-gray);
}

.dropdown-item:hover {
    background-color: var(--prestige-silver);
    color: var(--prestige-dark-gray);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-item-text {
    background-color: transparent;
    color: var(--prestige-gray) !important;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: default;
}


.table td {
    padding: 0.75rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilos para ordenamiento */
.sort-icon {
    font-size: 0.8rem;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.table thead th {
    user-select: none;
    transition: background-color 0.3s ease;
}

.table thead th:hover {
    background-color: #e9ecef;
}

.table thead th:hover .sort-icon {
    opacity: 1;
}

.sort-icon.text-primary {
    opacity: 1;
    color: var(--prestige-accent) !important;
}

/* Sidebar compacto */
.col-md-2 .list-group-item-action {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.col-md-2 .card-header h5 {
    font-size: 1rem;
}

.col-md-2 .list-group-item-action i {
    font-size: 0.9rem;
}

/* En móviles, usar el ancho completo */
@media (max-width: 768px) {
    .col-md-2, .col-md-10 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-md-2 {
        margin-bottom: 1rem;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn-group-sm > .btn, .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .prestige-logo {
        height: 30px;
    }
    
    .navbar-prestige {
        min-height: 60px;
    }
    
    /* Ajustes para tabla en móvil */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .d-flex.flex-column small:not(:first-child) {
        display: none;
    }
}

/* Select2 Custom Styles for Prestige Auto Theme */
.select2-container--bootstrap-5 .select2-selection--multiple {
    background-color: var(--prestige-white) !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    min-height: 38px !important;
    padding: 0.375rem 0.75rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple:focus-within {
    border-color: var(--prestige-accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.select2-container--bootstrap-5 .select2-selection__choice {
    background-color: var(--prestige-dark-gray) !important;
    color: var(--prestige-white) !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.125rem !important;
    font-size: 0.875rem !important;
}

.select2-container--bootstrap-5 .select2-selection__choice__remove {
    color: var(--prestige-light-gray) !important;
    font-weight: bold !important;
    margin-right: 0.5rem !important;
}

.select2-container--bootstrap-5 .select2-selection__choice__remove:hover {
    color: var(--prestige-white) !important;
}

.select2-dropdown {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--prestige-accent) !important;
    color: var(--prestige-white) !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 0.375rem 0.75rem !important;
}

/* Placeholder styling for Select2 */
.select2-container--bootstrap-5 .select2-selection__placeholder {
    color: #6c757d !important;
    font-style: italic !important;
}

/* Export Preview Table Scroll Styling */
#exportPreview .table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--prestige-gray) var(--prestige-silver);
}

#exportPreview .table-responsive::-webkit-scrollbar {
    width: 8px;
}

#exportPreview .table-responsive::-webkit-scrollbar-track {
    background: var(--prestige-silver);
    border-radius: 4px;
}

#exportPreview .table-responsive::-webkit-scrollbar-thumb {
    background: var(--prestige-gray);
    border-radius: 4px;
    transition: background 0.3s ease;
}

#exportPreview .table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--prestige-dark-gray);
}

/* Sticky header for export preview table */
#exportPreview .table thead th {
    position: sticky;
    top: 0;
    background-color: var(--prestige-silver) !important;
    z-index: 10;
    border-bottom: 2px solid var(--prestige-gray) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Estilos para el submenú de Configuración */
#configSubmenu {
    background-color: rgba(0, 0, 0, 0.02);
    border-left: 2px solid var(--prestige-light-gray);
    margin-left: 1rem;
    transition: all 0.3s ease-in-out;
}

#configSubmenu .list-group-item {
    border: none;
    background-color: transparent;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    color: var(--prestige-gray);
    transition: all 0.2s ease;
}

#configSubmenu .list-group-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--prestige-accent);
    padding-left: 1rem;
}

#configSubmenu .list-group-item.active {
    background-color: var(--prestige-accent);
    color: var(--prestige-white);
}

/* Animación del chevron */
.list-group-item i:last-child {
    transition: transform 0.3s ease;
}

/* Estilo para items de configuración de admin */
#adminConfigSubmenu .list-group-item {
    border: none;
    background-color: transparent;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    color: var(--prestige-gray);
}