/* Mobile Responsive CSS - Para dispositivos com largura < 1024px */

/* Reset e configurações base para mobile */
@media (max-width: 1023px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    /* Ajuste específico para o main content */
    main {
        padding-top: 1rem !important;
    }
    
    /* Ocultar elementos desktop */
    .desktop-only {
        display: none !important;
    }
    
    /* Mostrar elementos mobile */
    .mobile-only {
        display: block !important;
    }
    
    /* Layout principal - Stack vertical */
    .main-layout {
        flex-direction: column !important;
    }
    
    /* Sidebar desktop - ocultar */
    .bg-blue-800.w-64 {
        display: none !important;
    }
    
    /* Header desktop - ocultar */
    header.bg-white {
        display: none !important;
    }
    
    /* Conteúdo principal - ajustar para mobile */
    main {
        padding: 1rem !important;
        padding-top: 80px !important; /* Espaço para header mobile */
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Layout principal mobile */
    .main-content {
        padding: 1rem;
    }
    
    /* Header Mobile */
    .mobile-header {
        position: relative;
        background: #ffffff;
        color: #374151;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 1rem;
    }
    
    .mobile-header .header-icons {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: nowrap;
    }
    
    .mobile-header .right-icons {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mobile-header .header-icons .menu-button,
    .mobile-header .right-icons .notification-icon,
    .mobile-header .right-icons .profile-icon {
        background: none;
        border: none;
        color: #374151;
        font-size: 1.25rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
        transition: background-color 0.2s;
        flex-shrink: 0;
        cursor: pointer;
    }
    
    .mobile-header .right-icons .notification-icon {
        position: relative;
    }
    
    .mobile-header .header-icons .menu-button:hover,
    .mobile-header .right-icons .notification-icon:hover,
    .mobile-header .right-icons .profile-icon:hover {
        background-color: #f3f4f6;
    }
    
    /* Profile Dropdown */
    .mobile-header .profile-dropdown {
        position: relative;
    }
    
    .mobile-header .profile-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        min-width: 150px;
        z-index: 1000;
        margin-top: 0.25rem;
    }
    
    .mobile-header .profile-menu a,
    .mobile-header .profile-menu form {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
        margin: 0;
    }
    
    .mobile-header .profile-menu a,
    .mobile-header .profile-menu button {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        color: #374151;
        text-decoration: none;
        font-size: 0.875rem;
        transition: background-color 0.2s;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }
    
    .mobile-header .profile-menu a:hover,
    .mobile-header .profile-menu button:hover {
        background-color: #f3f4f6;
    }
    
    .mobile-header .profile-menu a:first-child {
        border-radius: 0.5rem 0.5rem 0 0;
    }
    
    .mobile-header .profile-menu form:last-child button {
        border-radius: 0 0 0.5rem 0.5rem;
        color: #dc2626;
    }
    
    .mobile-header .profile-menu a:last-child:hover {
        background-color: #fef2f2;
    }
    
    .mobile-header .notification-badge {
        position: absolute;
        top: 0.25rem;
        right: 0.25rem;
        background: #ef4444;
        color: white;
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
        border-radius: 50%;
        min-width: 1rem;
        height: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sidebar Mobile */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #153F59;
        z-index: 1100;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .mobile-sidebar.active {
        left: 0;
    }
    
    .mobile-sidebar-header {
        padding: 1.5rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-sidebar-title {
        color: white;
        font-size: 1.25rem;
        font-weight: bold;
    }
    
    .mobile-sidebar-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.25rem;
    }
    
    .mobile-nav {
        padding: 1rem 0;
    }
    
    .mobile-nav-item {
        display: block;
        padding: 0.75rem 1rem;
        color: rgba(255,255,255,0.9);
        text-decoration: none;
        border-left: 3px solid transparent;
        transition: all 0.2s;
    }
    
    .mobile-nav-item:hover,
    .mobile-nav-item.active {
        background: rgba(255,255,255,0.1);
        border-left-color: white;
        color: white;
    }
    
    .mobile-nav-item i {
        width: 20px;
        margin-right: 0.75rem;
    }
    
    /* Overlay para sidebar mobile */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Grids responsivos */
    .grid {
        gap: 1rem !important;
    }
    
    /* Grid de 4 colunas -> 2 colunas */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Grid de 3 colunas -> 1 coluna */
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    /* Cards e componentes */
    .stat-card,
    .course-card {
        margin-bottom: 1rem;
    }
    
    /* Textos responsivos */
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .text-xl {
        font-size: 1.125rem !important;
    }
    
    /* Padding e margin responsivos */
    .p-6 {
        padding: 1rem !important;
    }
    
    .p-5 {
        padding: 0.875rem !important;
    }
    
    .mb-6 {
        margin-bottom: 1rem !important;
    }
    
    .gap-6 {
        gap: 1rem !important;
    }
    
    /* Botões responsivos */
    .flex-row {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .w-auto {
        width: 100% !important;
    }
    
    /* Formulários responsivos */
    .filter-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Imagens responsivas */
    .course-thumbnail {
        height: 200px !important;
    }
    
    /* Modais responsivos */
    .modal {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
    }
    
    /* Tabelas responsivas */
    .table-responsive {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Animações suaves para mobile */
    .slide-up {
        animation: slideUpMobile 0.4s ease-out;
    }
    
    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Touch targets - mínimo 44px */
    .touch-target {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Scrollbar customizada para mobile */
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
}

/* Media query para tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Grid de 4 colunas -> 3 colunas em tablets */
    .grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Grid de 3 colunas -> 2 colunas em tablets */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Sidebar mobile um pouco maior em tablets */
    .mobile-sidebar {
        width: 320px;
    }
    
    /* Botões em linha em tablets */
    .flex-row {
        flex-direction: row !important;
    }
    
    .w-auto {
        width: auto !important;
    }
}

/* Media query para smartphones (< 768px) */
@media (max-width: 767px) {
    body {
        font-size: 13px;
    }
    
    main {
        padding: 0.75rem !important;
    }
    
    .p-6 {
        padding: 0.75rem !important;
    }
    
    .text-3xl {
        font-size: 1.25rem !important;
    }
    
    .text-2xl {
        font-size: 1.125rem !important;
    }
    
    /* Todos os grids em 1 coluna em smartphones */
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    .course-thumbnail {
        height: 160px !important;
    }
}