/* ============================================
   PROMPT MODULE STYLES
   Sistema de pestañas y navegación para contenido educativo
   ============================================ */

/* Contenedor principal de pestañas */
.content-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.content-panel.expanded {
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    max-height: none;
    bottom: 50%;
    right: 50%;
    transform: translate(50%, 50%);
}

/* Pestañas principales (Noticias / Prompt) */
.main-tabs {
    display: flex;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 0;
    border-bottom: 2px solid var(--teal);
    position: relative;
    align-items: center;
}

/* Contenedor de botones de control */
.panel-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    padding: 0 1rem;
}

.main-tab-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.main-tab-btn i {
    font-size: 1.2rem;
}

.main-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-tab-btn.active {
    background: white;
    color: var(--primary-dark);
}

.main-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--teal);
}

/* Botón de cerrar */
.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    background: rgba(255, 50, 50, 0.7);
    transform: scale(1.1);
}

/* Botón de expandir/contraer */
.expand-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.expand-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Contenido de pestañas */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Navegación de categorías (Texto/Imagen/Video/Audio) */
.category-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--light-bg);
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-btn:hover {
    border-color: var(--teal);
    background: rgba(0, 167, 157, 0.05);
}

.category-btn.active {
    background: var(--teal);
    color: white;
    border-color: var(--teal);
}

/* Navegación de niveles (Básico/Avanzado) */
.level-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.level-btn {
    flex: 1;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.level-btn:hover {
    background: #e9ecef;
}

.level-btn.active {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

/* Área de contenido */
.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

/* Grid de contenido (para nivel básico) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.content-card:hover {
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(0, 167, 157, 0.15);
    transform: translateY(-4px);
}

.content-icon {
    font-size: 3rem;
    text-align: center;
}

.content-card h3 {
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin: 0;
}

.content-card p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    flex: 1;
}

.content-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-open {
    flex: 1;
    padding: 0.75rem;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-open:hover {
    background: var(--purple);
    transform: translateY(-2px);
}

/* Contenido avanzado (carpetas y archivos) */
.advanced-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.folder-section {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.folder-header {
    background: linear-gradient(135deg, var(--teal), var(--purple));
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.folder-header i {
    font-size: 1.5rem;
}

.folder-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.folder-files {
    padding: 0;
}

.file-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: rgba(0, 167, 157, 0.05);
}

.file-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--teal);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}

.file-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
}

.btn-file-open {
    background: var(--teal);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-file-open:hover {
    background: var(--purple);
    transform: scale(1.1);
}

/* Estado vacío */
.empty-content {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #999;
}

.empty-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-content h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: #999;
}

/* Botón flotante para abrir el panel */
.floating-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--teal), var(--purple));
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 167, 157, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 8999;
}

.floating-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 167, 157, 0.6);
}

.floating-trigger.hidden {
    display: none;
}

/* Badge de notificaciones */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .content-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
    }

    .content-panel.expanded {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        transform: none;
        border-radius: 0;
    }

    .main-tab-btn {
        font-size: 0.85rem;
        padding: 0.75rem 0.5rem;
    }

    .category-nav {
        padding: 0.75rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .folder-header {
        padding: 1rem;
    }

    .file-item {
        padding: 0.75rem 1rem;
    }

    .floating-trigger {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
}

/* Animaciones */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.content-panel {
    animation: slideUp 0.4s ease-out;
}

/* Scrollbar personalizada */
.content-area::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.content-area::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: var(--teal);
    border-radius: 10px;
}

.content-area::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* ===================================
   NUEVA VISTA DE CARPETAS - NIVEL AVANZADO
   =================================== */

/* Vista de grid de carpetas */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.folder-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.folder-card:hover {
    border-color: var(--teal);
    box-shadow: 0 8px 16px rgba(0, 167, 157, 0.15);
    transform: translateY(-4px);
}

.folder-icon {
    font-size: 4rem;
    color: var(--teal);
    transition: all 0.3s ease;
}

.folder-card:hover .folder-icon {
    color: var(--purple);
    transform: scale(1.1);
}

.folder-card h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin: 0;
}

.folder-count {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-actions {
    width: 100%;
    margin-top: auto;
}

.btn-open-folder {
    width: 100%;
    padding: 0.75rem;
    background: var(--teal);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-open-folder:hover {
    background: var(--purple);
}

/* Vista de contenido de carpeta */
.folder-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.folder-breadcrumb {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-back {
    background: var(--teal);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-back:hover {
    background: var(--purple);
    transform: translateX(-4px);
}

.folder-breadcrumb h2 {
    margin: 0;
    color: var(--primary-dark);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
