/* 
* Estilos responsivos para la Escuela Manuel Belgrano N°37
* Incluye estilos para el sitio web público y el panel de administración
*/

/* Breakpoints comunes:
- 1200px: Pantallas grandes y desktop
- 992px: Laptops y tablets horizontales
- 768px: Tablets verticales
- 576px: Móviles en modo horizontal
- 480px: Móviles pequeños
*/

/* ===== ESTILOS GENERALES RESPONSIVOS ===== */

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    /* Ajustes para el panel de administración */
    .admin-sidebar {
        width: 250px;
    }
    
    .admin-content {
        margin-left: 250px;
    }
    
    .estadisticas {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .admin-actions-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    /* Ajustes para el panel de administración */
    .admin-sidebar {
        width: 220px;
    }
    
    .admin-content {
        margin-left: 220px;
        padding: 1.25rem;
    }
    
    .admin-menu-link {
        padding: 0.6rem 1.25rem;
    }
    
    .admin-header-container {
        padding: 0 1.25rem;
    }
    
    .estadisticas {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    .contenido-principal {
        grid-template-columns: 1fr;
    }
    
    /* Ajustes para el sitio público */
    .tareas-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    /* Ajustes para menú en móvil */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        height: calc(100vh - 70px);
        width: 280px;
        background-color: var(--dark-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        transition: 0.5s;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        margin: 0.75rem 0;
        width: 100%;
    }
    
    .nav-link {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
        color: white;
    }
    
    .burger {
        display: block;
    }
    
    /* ===== PANEL DE ADMINISTRACIÓN EN TABLETS ===== */
    /* Toggle para menú lateral */
    .admin-menu-toggle {
        display: block;
        margin-right: 1rem;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 100;
        box-shadow: var(--shadow-lg);
        width: 280px;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        width: 100%;
    }
    
    .admin-header {
        z-index: 101;
    }
    
    .admin-content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-content-actions {
        margin-top: 1rem;
        width: 100%;
    }
    
    .admin-content-actions .btn {
        flex: 1;
    }
    
    .admin-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
        display: none;
    }
    
    .admin-overlay.active {
        display: block;
    }
    
    /* Ajustes para estadísticas y acciones */
    .estadisticas {
        grid-template-columns: 1fr;
    }
    
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ajustes para la bienvenida */
    .bienvenida {
        flex-direction: column;
    }
    
    .bienvenida-acciones {
        margin-top: 1rem;
        width: 100%;
    }
    
    .bienvenida-acciones .btn {
        flex: 1;
    }
    
    /* Ajustes para tareas */
    .tareas-filtros {
        flex-direction: column;
    }
    
    .filtro-grupo, .filtro-busqueda {
        width: 100%;
        min-width: 100%;
    }
    
    .filtro-acciones {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Ajustes para sitio público */
    .tareas-informacion {
        flex-direction: column;
        text-align: center;
    }
    
    .info-icon {
        margin: 0 auto 15px;
    }
    
    .info-leyenda {
        justify-content: center;
    }
    
    .tareas-filtros {
        flex-direction: column;
    }
    
    .tareas-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 576px) {
    /* ===== PANEL DE ADMINISTRACIÓN EN MÓVILES ===== */
    .admin-header-container {
        padding: 0 1rem;
    }
    
    .admin-logo span {
        display: none;
    }
    
    .admin-user-info {
        display: none;
    }
    
    .admin-card-header {
        padding: 1rem;
    }
    
    .admin-card-content {
        padding: 1rem;
    }
    
    /* Ajustes para alertas y mensajes */
    .admin-alert {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .admin-alert i {
        margin: 0 0 0.5rem;
        font-size: 1.5rem;
    }
    
    /* Ajustes para acciones de formulario */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Ajustes para tablas */
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) {
        display: none;
    }
    
    /* Ajustes para tareas en móvil */
    .tarea-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tarea-curso-materia, .tarea-fecha {
        margin-bottom: 0.5rem;
    }
    
    .tarea-acciones {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tarea-acciones .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Ajustes para el sitio público en móvil */
    .page-banner h1 {
        font-size: 1.75rem;
    }
    
    .section-heading h2 {
        font-size: 1.5rem;
    }
    
    .tarea-header {
        padding: 15px;
    }
    
    .tarea-titulo {
        font-size: 16px;
    }
    
    .tarea-meta-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tarea-estado {
        position: static;
        margin-top: 10px;
        width: fit-content;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .tarea-detalle-info {
        grid-template-columns: 1fr;
    }
    
    .tarea-content {
        font-size: 14px;
    }
    
    /* Ajustes generales para botones */
    .btn {
        font-size: 14px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    /* Ajustes para los móviles más pequeños */
    .admin-header-container {
        padding: 0 0.75rem;
    }
    
    .admin-logo i {
        font-size: 1.25rem;
    }
    
    .admin-content {
        padding: 1rem 0.75rem;
    }
    
    .admin-content-header h1 {
        font-size: 1.25rem;
    }
    
    /* Ocultar más columnas en tablas */
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }
    
    /* Ajustar tamaños de modal */
    .modal-content {
        width: 95%;
        margin: 15px auto;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
    }
}

/* Estilos específicos para pantallas táctiles */
@media (hover: none) {
    .btn:hover, .admin-menu-link:hover, .action-btn:hover {
        transform: none;
    }
}

/* Estilos para dispositivos de altura reducida */
@media (max-height: 600px) {
    .admin-nav {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Soporte para modo oscuro */
@media (prefers-color-scheme: dark) {
    .admin-body {
        background-color: #1a1a1a;
    }
    
    .admin-sidebar, .admin-header, .admin-card {
        background-color: #2d2d2d;
        border-color: #3d3d3d;
    }
    
    .admin-menu-link {
        color: #e0e0e0;
    }
    
    .admin-menu-link:hover, .admin-menu-item.active .admin-menu-link {
        background-color: rgba(59, 130, 246, 0.2);
        color: #3b82f6;
        border-left-color: #3b82f6;
    }
}

/* Añadir clases de utilidad para diseño responsive */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

@media (min-width: 576px) {
    .d-sm-none {
        display: none !important;
    }
    
    .d-sm-block {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }
    
    .d-md-block {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
    
    .d-lg-block {
        display: block !important;
    }
}

@media (min-width: 1200px) {
    .d-xl-none {
        display: none !important;
    }
    
    .d-xl-block {
        display: block !important;
    }
}

/* Estilos para la animación del botón hamburguesa cuando se hace clic */
.burger.active .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger.active .line2 {
    opacity: 0;
}

.burger.active .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}