/* =====================================================
   AULA OZOSALUD - ESTILOS PRINCIPALES
   ===================================================== */

:root {
    --primary-color: #1e3a5f;
    --primary-dark: #0f1f33;
    --primary-light: #2c5282;
    --secondary-color: #f8f9fa;
    --accent-color: #c53030;
    --danger-color: #c53030;
    --warning-color: #ffc107;
    --info-color: #2b6cb0;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 25px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* LOGIN PAGE */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f1f33 0%, #1e3a5f 50%, #2c5282 100%);
    padding: 20px;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #c53030 0%, #c53030 100%);
}

.login-box {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

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

.login-logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.login-logo p {
    color: var(--text-muted);
    margin-top: 5px;
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 74, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-success {
    background: #2b6cb0;
    color: white;
}

.btn-success:hover {
    background: #1e4e8c;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: #212529;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ALERTS */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* LAYOUT - DASHBOARD */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.sidebar-header small {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #c53030;
}

.sidebar-menu .menu-section {
    padding: 10px 20px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    margin-top: 10px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

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

.content-header h1 {
    font-size: 26px;
    color: var(--primary-dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .user-name {
    font-weight: 500;
}

/* CARDS */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.card-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
}

.card-body {
    padding: 25px;
}

.card-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.green { background: #dbeafe; color: #1e3a5f; }
.stat-icon.blue { background: #dbeafe; color: #2b6cb0; }
.stat-icon.yellow { background: #fff3cd; color: #ffc107; }
.stat-icon.red { background: #fed7d7; color: #c53030; }

.stat-info h4 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
}

/* TABLES */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table .actions {
    display: flex;
    gap: 8px;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #dbeafe; color: #1e3a5f; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* CLASE/VIDEO VIEW */
.clase-viewer {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.clase-info {
    padding: 25px;
}

.clase-info h2 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.clase-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* TABS */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* FILE DOWNLOAD */
.file-download {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: var(--radius);
    text-align: center;
    justify-content: center;
    flex-direction: column;
}

.file-icon {
    font-size: 60px;
    color: var(--primary-color);
}

/* GRID CLASSES */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* UTILITIES */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-color); }
.text-danger { color: var(--danger-color); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.p-2 { padding: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* MENÚ HAMBURGUESA MÓVIL */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-dark);
    color: white;
    padding: 0 15px;
    z-index: 1001;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.mobile-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    position: relative;
    transition: var(--transition);
}

.menu-toggle span::before,
.menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
    transition: var(--transition);
}

.menu-toggle span::before {
    top: -8px;
}

.menu-toggle span::after {
    bottom: -8px;
}

.menu-toggle.active span {
    background: transparent;
}

.menu-toggle.active span::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-toggle.active span::after {
    transform: rotate(-45deg);
    bottom: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
        padding: 25px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
        padding: 20px;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal {
        max-width: 90%;
        margin: 20px;
    }
    .modal-lg {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    /* Mostrar header móvil */
    .mobile-header {
        display: flex;
    }

    /* Sidebar como overlay */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        padding-top: 0;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px;
    }

    .dashboard {
        flex-direction: column;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .stat-info h4 {
        font-size: 22px;
    }

    .content-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .content-header h1 {
        font-size: 22px;
    }

    /* Tablas responsivas */
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .table .actions {
        flex-direction: column;
        gap: 5px;
    }

    .table .actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Cards */
    .card-body {
        padding: 15px;
    }

    .card-header {
        padding: 12px 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Modales */
    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 70px;
    }

    .modal {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius);
    }

    .modal-header {
        padding: 15px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }

    /* Botones */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

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

    /* Formularios */
    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Dia/Horario en modales */
    .dia-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .dia-check {
        width: 100%;
    }

    .dia-horario {
        flex-wrap: wrap;
        gap: 5px;
    }

    .dia-horario input {
        flex: 1;
        min-width: 80px;
    }

    /* Checkbox grid */
    .checkbox-grid {
        grid-template-columns: 1fr;
        max-height: 150px;
    }

    /* Tabs */
    .tabs-nav {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-btn {
        flex: 1;
        min-width: 80px;
        padding: 8px 10px;
        font-size: 13px;
        text-align: center;
    }

    /* Login */
    .login-box {
        padding: 30px 20px;
        margin: 15px;
    }

    .login-logo h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 70px 10px 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-info h4 {
        font-size: 18px;
    }

    .stat-info p {
        font-size: 11px;
    }

    .content-header h1 {
        font-size: 18px;
    }

    .table th,
    .table td {
        padding: 8px 5px;
        font-size: 12px;
    }

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

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Vista del visor de clases */
    .clase-info {
        padding: 15px;
    }

    .clase-info h2 {
        font-size: 18px;
    }

    .clase-meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 12px;
    }
}

/* Mejoras para impresión */
@media print {
    .sidebar,
    .mobile-header,
    .btn,
    .modal-overlay {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}
