/* dashboard.css - Estilos específicos para el panel administrativo */

:root {
    --admin-primary: #0f3460;
    --admin-secondary: #4cc9f0;
    --admin-accent: #ff6b35;
    --admin-success: #2ecc71;
    --admin-warning: #f39c12;
    --admin-danger: #e74c3c;
    --admin-light: #f8f9fa;
    --admin-dark: #343a40;
    --admin-gray: #6c757d;
}

/* Estilos generales del dashboard */
.admin-body {
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar (si decides agregar uno más tarde) */
.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--admin-primary) 0%, #1a4a7a 100%);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.admin-sidebar .brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.admin-sidebar .brand h2 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-sidebar .nav-menu {
    list-style: none;
    padding: 0;
}

.admin-sidebar .nav-item {
    margin-bottom: 5px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 12px 20px;
    display: block;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left-color: var(--admin-accent);
}

.admin-sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* Contenido principal */
.admin-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
}

/* Cards de estadísticas mejoradas */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1));
    border-radius: 0 0 0 100px;
}

/* Gráficos responsive */
.chart-container {
    position: relative;
    height: 300px;
}

/* Tablas */
#ordersTable {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
}

#ordersTable thead {
    background: linear-gradient(90deg, var(--admin-primary), #1a4a7a);
    color: white;
}

#ordersTable th {
    padding: 15px;
    font-weight: 600;
    border: none;
}

#ordersTable td {
    padding: 12px 15px;
    vertical-align: middle;
}

#ordersTable tbody tr {
    transition: all 0.3s ease;
}

#ordersTable tbody tr:hover {
    background-color: rgba(15, 52, 96, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Badges para estados */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
}

.status-procesando {
    background-color: #cce5ff;
    color: #004085;
}

.status-enviado {
    background-color: #d4edda;
    color: #155724;
}

.status-entregado {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Botones de acción */
.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin: 0 2px;
}

.btn-view {
    background-color: var(--admin-secondary);
    color: white;
}

.btn-edit {
    background-color: var(--admin-success);
    color: white;
}

.btn-delete {
    background-color: var(--admin-danger);
    color: white;
}

.btn-update {
    background-color: var(--admin-warning);
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Mapa */
#salesMap {
    border: 2px solid #e0e0e0;
}

.leaflet-popup-content {
    font-family: 'Segoe UI', sans-serif;
}

.leaflet-popup-content h4 {
    color: var(--admin-primary);
    margin-top: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 70px;
        overflow: hidden;
    }
    
    .admin-sidebar .brand h2,
    .admin-sidebar .nav-link span {
        display: none;
    }
    
    .admin-sidebar .nav-link {
        text-align: center;
        padding: 15px 0;
    }
    
    .admin-sidebar .nav-link i {
        margin: 0;
        font-size: 1.2rem;
    }
    
    .admin-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .charts-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card, .chart-container, .map-container, .table-container {
    animation: fadeIn 0.6s ease-out;
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--admin-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modales (para futuras funcionalidades) */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* dashboard.css - Estilos actualizados */

/* Modal styles */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    color: #0f3460;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #e74c3c;
}

#modal-body {
    padding: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Estilos para la tabla con checkboxes */
#ordersTable th:first-child,
#ordersTable td:first-child {
    width: 50px;
    text-align: center;
}

#ordersTable input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Estilos para el grid de productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}