/* ============================================================
   LMS VirtualMedia - Estilos personalizados
   Bootstrap 5.3 Admin Panel
   ============================================================ */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #0d6efd;
    --topbar-height: 60px;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.3s ease;
}

.sidebar .nav-link {
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    transition: background-color 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
}

.sidebar .nav-link.active {
    background-color: var(--sidebar-active);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* ---- Navbar ---- */
.navbar {
    min-height: var(--topbar-height);
}

/* ---- Sidebar responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1029;
    }
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
}

/* ---- Tablas ---- */
.table > thead > tr > th {
    background-color: #f8f9fa;
    border-bottom-width: 2px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6c757d;
}

.table > tbody > tr > td {
    vertical-align: middle;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* ---- Badges y estados ---- */
.badge-soft-primary {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.badge-soft-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.badge-soft-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* ---- Botones ---- */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.btn-icon i {
    font-size: 1rem;
}

/* ---- Estadísticas ---- */
.stat-card {
    border-left: 4px solid;
}

.stat-card.primary { border-left-color: #0d6efd; }
.stat-card.success { border-left-color: #198754; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger  { border-left-color: #dc3545; }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ---- Paginación ---- */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: 0.375rem !important;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.page-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.page-item.disabled .page-link {
    opacity: 0.5;
}

/* ---- Formularios ---- */
.form-label {
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\F285";
    font-family: "bootstrap-icons";
    font-size: 0.75rem;
}

/* ---- Login page ---- */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 420px;
    width: 100%;
}

.login-card .card {
    border-radius: 1rem;
    overflow: hidden;
}

/* ---- Print / Export ---- */
@media print {
    .sidebar,
    .navbar,
    .btn,
    footer {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* ---- Animaciones ---- */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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