:root {
    --primary-color: #D988B9; 
    --primary-hover: #C572A2;
    --bg-light: #FDFDFD;
    --bg-card: #FFFFFF;
    --text-main: #2D3748;
    --text-muted: #A0AEC0;
    --glass-border: rgba(0, 0, 0, 0.03);
    --sidebar-bg: #FFFFFF;
    --sidebar-text: #4A5568;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography Hierarchy */
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--primary-color);
    text-transform: uppercase;
}
.navbar-logo {
    height: 55px;
    width: auto;
    display: block;
    margin: 0 auto;
}
.navbar-logo-secondary {
    height: 55px;
    width: auto;
    display: block;
    margin: 0 auto;
}
.subtitle { font-size: 0.75rem; font-weight: 500; color: #CBD5E0; letter-spacing: 0.05em; }

/* Layout & Spacing */
.app-container { min-height: 100vh; gap: 0; }

/* Sidebar - Ultra Clean */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid #F1F5F9;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding-top: 2rem;
}

.sidebar-header {
    padding: 0 1.5rem 2.5rem 1.5rem;
}

@media (max-width: 991.98px) {
    .sidebar { width: 300px; padding-top: 0; }
}

/* Cards & Containers - Soft & Floating */
.glass-card {
    background: var(--bg-card);
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.main-content {
    background-color: var(--bg-light);
}

.glass-navbar {
    background: #FFFFFF;
    border-bottom: 1px solid #F1F5F9;
}

/* El menú scrollea y el pie de sesión queda siempre visible al fondo del sidebar.
   En mobile (offcanvas) es lo que evita que el botón se pierda al bajar por los días. */
.sidebar-menu {
    flex: 1 1 auto;
    overflow-y: auto;
}

.sidebar-logout {
    flex-shrink: 0;
    border-top: 1px solid #F1F5F9;
    margin-top: auto;
}

/* En escritorio el sidebar se queda fijo al alto de la pantalla y scrollea sólo el menú.
   Sin esto el sidebar crece con los 12 módulos y "Cerrar sesión" cae al fondo de la
   página, fuera de la vista. En mobile lo resuelve el offcanvas de Bootstrap. */
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }
}

/* Sidebar Menu */
.module-header {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #CBD5E0;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.lesson-item:hover {
    background: #F8FAFC;
    color: var(--primary-color);
}

.lesson-item.active {
    background: #FFF5F7;
    color: var(--primary-color);
    font-weight: 700;
    border-right: 3px solid var(--primary-color);
}

.lesson-icon {
    margin-right: 1rem;
    font-size: 1rem;
    color: #CBD5E0;
}

.lesson-item.active .lesson-icon,
.lesson-item:hover .lesson-icon {
    color: var(--primary-color);
}

/* Buttons - Minimalist Pill */
.btn-primary {
    background: var(--primary-color);
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 20px rgba(217, 136, 185, 0.2);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(217, 136, 185, 0.3);
}

.btn-outline-primary {
    border: 1px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: transparent !important;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.text-primary { color: var(--primary-color) !important; }

#lessonSubtitle {
    font-size: 1.5rem;
    letter-spacing: 0.05em;
}

/* Step Numbers */
.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Transitions & Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-fade-in-scale {
    animation: fadeInScale 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.logo-float {
    animation: floatLogo 4s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    70% { transform: scale(1); }
}

@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(217, 136, 185, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(217, 136, 185, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 136, 185, 0); }
}

.heart-beat {
    animation: heartbeat 2s ease-in-out infinite;
    display: inline-block;
}

.btn-pulse {
    animation: pulse-soft 2s infinite;
}

.animate-fade-in {
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
/* Access Overlay */
.access-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: block;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.access-modal {
    max-width: 450px;
    width: 100%;
    margin: auto;
    background: white !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
}

.custom-input {
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.custom-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(217, 136, 185, 0.1);
}

/* Deterrente básico anti-copia del contenido del programa (ver app.js para el bloqueo de
   clic derecho/copy); se reactiva la selección en inputs/textarea para no romper formularios. */
#mediaPlayerContainer {
    user-select: none;
    -webkit-user-select: none;
}

#mediaPlayerContainer input,
#mediaPlayerContainer textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* Video / Audio Cards */
.audio-card {
    border: 1px solid #F1F5F9;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 2rem !important;
}

.icon-circle.bg-primary {
    background-color: #FFF5F7 !important;
    color: var(--primary-color) !important;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 10px; }

/* NATIVE DOCUMENT STYLING - High Readability */
.html-doc-container {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 2rem !important;
}

.doc-watermark {
    text-align: right;
    margin-bottom: 0.75rem;
}

.doc-watermark img {
    height: 28px;
    width: auto;
    opacity: 0.85;
}

.native-doc-content {
    color: #4A5568 !important;
    line-height: 1.8;
    width: 100%;
    font-size: 1.1rem;
}

.native-doc-content h1, 
.native-doc-content h2, 
.native-doc-content h3 {
    color: var(--text-main) !important;
    font-weight: 800;
    border-bottom: none;
    margin-top: 3rem;
}

.native-doc-content h2 { font-size: 1.5rem; color: var(--primary-color) !important; }

.native-doc-content strong { color: var(--text-main); font-weight: 700; }

/* Table Branding - Refined to be less intrusive */
.native-doc-content table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin: 2rem 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

.native-doc-content table td, 
.native-doc-content table th {
    padding: 1rem !important;
    border: 1px solid #F1F5F9 !important;
    color: var(--text-main) !important;
    vertical-align: middle !important;
}

/* Header styling - Only if it has background or specifically for th */
.native-doc-content table thead th {
    background-color: #F8FAFC !important;
    color: var(--text-main) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.05em !important;
}

/* Specific styling for labels in first column */
.native-doc-content table td:first-child {
    font-weight: 600;
}

/* Adjust table responsive for better container fit */
.table-responsive {
    border: none !important;
}

/* Satisfaction Form Styles */
.satisfaction-card {
    border: 1px solid #F1F5F9;
    background: #FFFFFF;
    border-radius: 20px;
}

.form-label-custom {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.5rem;
}

/* Hide redundant titles inside injected work docs */
.work-document-container .doc-content-injector p:first-child,
.work-document-container .doc-content-injector p:nth-child(2) {
    display: none;
}

/* Accordion Custom Styling */
.accordion-button:not(.collapsed) {
    background-color: #FFF5F7 !important;
    color: var(--primary-color) !important;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(217, 136, 185, 0.1);
}

.accordion-button::after {
    filter: sepia(100%) hue-rotate(280deg) saturate(200%);
}

.list-group-item i {
    font-size: 1.2rem;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}
