/* =====================================================
   PANEL DE ALUMNOS - AULA VIRTUAL
   ===================================================== */

.student-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
    padding-bottom: 80px; /* Espacio para barra de navegación del sistema */
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botón de Notas - Agregado para funcionalidad de notas */
.notes-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.1em;
    width: 40px;
    height: 40px;
}

.notes-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.category-tabs-three .category-tab {
    max-width: 200px;
    flex: 1 1 140px;
    padding: 12px 16px;
    font-size: 14px;
}

.category-tab {
    flex: 1;
    max-width: 300px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.category-tab.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Diarias: día del alumno + pestañas Hoy / anteriores / todos */
.diarias-meta {
    text-align: center;
    color: white;
}

.diarias-day-label {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.diarias-view-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.diarias-view-tab {
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.diarias-view-tab:hover {
    background: rgba(255, 255, 255, 0.28);
}

.diarias-view-tab.active {
    background: white;
    color: #5a67d8;
    border-color: white;
}

.material-day-badge {
    display: inline-block;
    background: rgba(102, 126, 234, 0.95);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 8px;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    min-width: 0; /* Para que funcione el flex correctamente */
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.clear-search:hover {
    color: #666;
}

.order-select {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    max-width: 250px;
    flex-shrink: 0; /* No se comprime */
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.order-select:focus {
    outline: none;
}

/* Type Filters */
.type-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.type-filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.type-filter-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.type-filter-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.type-filter-btn .badge {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.type-filter-btn.active .badge {
    background: #667eea;
    color: white;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.no-results i {
    opacity: 0.5;
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Material Card */
.material-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.material-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.material-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Default: video */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Colores de fondo específicos por tipo - ocupan todo el ancho */
.material-card[data-type="pdf"] .material-thumbnail {
    background: #ec4444; /* Rojo para PDF */
}

.material-card[data-type="grabacion"] .material-thumbnail {
    background: #f59e0b; /* Naranja para Reuniones */
}

.material-card[data-type="imagen"] .material-thumbnail {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Verde para Imágenes */
}

.material-card[data-type="recomendado"] .material-thumbnail {
    background: linear-gradient(135deg, #764ba2 0%, #9f7aea 100%); /* Morado oscuro para Recomendados */
}

.material-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.material-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.material-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.material-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.material-title-row .material-title {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.material-note-btn {
    flex-shrink: 0;
    border: none;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.material-note-btn:active {
    opacity: 0.88;
}

.material-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.material-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.material-date {
    font-size: 12px;
    color: #999;
}

.material-action {
    color: #667eea;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.material-card:hover .material-action {
    transform: translateX(5px);
}

/* Modal */
.material-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.material-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.modal-header {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.modal-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

.modal-body {
    padding: 30px;
}

.iframe-video,
.iframe-content {
    width: 100%;
    height: 500px;
    border-radius: 10px;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.external-link-container {
    text-align: center;
    padding: 60px 40px;
}

.external-icon {
    opacity: 0.3;
}

.external-link-container p {
    color: #333;
    margin: 0 auto;
    max-width: 500px;
}

.external-link-btn {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.external-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (min-width: 768px) {
    .student-dashboard {
        padding: 20px;
        padding-bottom: 40px;
    }
    
    .materials-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 25px;
    }
    
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .category-tab {
        font-size: 16px;
        padding: 15px 30px;
    }
    
    .type-filter-btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .material-card:hover {
        transform: translateY(-8px);
    }
}

@media (min-width: 1024px) {
    .materials-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (max-width: 767px) {
    .student-dashboard {
        padding: 15px;
        padding-bottom: 100px; /* Más espacio en móvil para barra de navegación */
    }

    .category-tabs {
        flex-direction: row;
        gap: 8px;
    }

    .category-tab {
        max-width: 100%;
        flex: 1;
        min-width: 0;
        padding: 10px 15px;
        font-size: 13px;
    }

    .search-bar {
        flex-direction: column;
        gap: 10px;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .order-select {
        width: 100%;
        max-width: 100%;
        font-size: 14px;
    }

    .type-filters {
        gap: 6px;
        justify-content: flex-start;
    }

    .type-filter-btn {
        font-size: 12px;
        padding: 7px 14px;
    }

    .materials-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .material-card:hover {
        transform: none;
    }

    .material-modal {
        padding: 10px;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    .iframe-video,
    .iframe-content {
        height: 300px;
    }

    .dashboard-header {
        flex-direction: row;
        gap: 8px;
    }

    .dashboard-title {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .notes-button {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }
}

/* ===================================================== 
   BLOQUEO DE SUSCRIPCIÓN
   ===================================================== */

.subscription-block {
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.block-icon {
    animation: pulse-lock 2s infinite;
}

@keyframes pulse-lock {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.subscription-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.subscription-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.subscription-btn:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .subscription-block {
        padding: 40px 15px;
    }

    .subscription-btn {
        width: 100%;
        max-width: 300px;
    }
}
