:root {
    --bg-color: #f8fafc;
    --text-color: #334155;
    --primary-color: #0f172a;
    --secondary-color: #3b82f6;
    --secondary-hover: #2563eb;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --card-bg: #ffffff;
    --hover-bg: #f1f5f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

header.app-header {
    background-color: var(--card-bg);
    color: var(--primary-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.logo-title {
    flex: 1;
    max-width: 600px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

/* Progress bar container */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.progress-track {
    flex: 1;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

#progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), #60a5fa);
    border-radius: 9999px;
    transition: width 0.5s ease-out;
}

#progreso-global {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-box h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.modal-box p {
    color: #475569;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-buttons .btn-primary {
    justify-content: center;
    padding: 1rem;
    font-size: 1.1rem;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-secondary {
    background-color: #94a3b8;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background-color: #64748b;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-success:hover {
    background-color: #059669; /* darker emerald */
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.btn-danger:hover {
    background-color: #dc2626; /* darker red */
    transform: translateY(-1px);
}

main.accordion-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1rem;
}

/* Accordion styles */
.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 1.25rem 1.5rem;
    background-color: var(--card-bg);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.accordion-header:hover {
    background-color: var(--hover-bg);
}

.accordion-header.active {
    background-color: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
}

/* Estado completado del acordeón */
.accordion-completed {
    background-color: #f0fdf4 !important; /* Tailwind green-50 */
    border-left: 4px solid var(--success-color);
}
.accordion-completed .header-status {
    background: transparent;
    color: var(--success-color);
    font-size: 1rem;
}

/* --- Gamificación: etapas de progreso por carpeta --- */
.accordion-header { position: relative; }
.accordion-header::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 4px;
    width: var(--folder-pct, 0%);
    background: #cbd5e1;
    transition: width 0.5s ease-out, background 0.3s;
}
.stage-started  { background-color: #fefce8 !important; border-left: 4px solid #eab308; }
.stage-started::after  { background: #eab308; }
.stage-started .header-status  { background: #fef08a; color: #854d0e; }

.stage-advanced { background-color: #eff6ff !important; border-left: 4px solid #3b82f6; }
.stage-advanced::after { background: #3b82f6; }
.stage-advanced .header-status { background: #bfdbfe; color: #1e40af; }

.accordion-completed::after { background: var(--success-color); }

/* --- Rechazados: etiqueta en encabezado y resaltado de tarjeta --- */
.header-badges { display: flex; gap: 0.5rem; align-items: center; }
.header-rejected {
    font-size: 0.85rem;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.header-rejected:hover { background: #fecaca; transform: translateY(-1px); }
.slide-card:has(.status-rejected) { border-left: 4px solid var(--danger-color); }
.flash-rejected { animation: flashRejected 1.6s ease-out; }
@keyframes flashRejected {
    0%, 40% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.6); }
    100%    { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
}

.accordion-content {
    display: none;
    padding: 2rem 1.5rem;
    background-color: #f8fafc;
}

.accordion-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sub-accordion */
.sub-accordion-container {
    margin-top: 1rem;
}

/* Slides Grid */
.slides-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.slide-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.slide-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.slide-header h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.slide-content-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.media-error {
    padding: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px dashed #ef4444;
    border-radius: 8px;
    font-weight: 600;
}

.media-section img {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #0f172a;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.img-ampliable {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.img-ampliable:hover {
    transform: scale(1.01);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Lightbox Styles */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #94a3b8;
    font-size: 3rem;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 100001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ef4444;
}

.media-section audio {
    width: 100%;
    margin-top: 1.5rem;
    border-radius: 999px;
}

.text-section h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.text-section p {
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    white-space: pre-wrap;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.review-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-approve {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-approve:hover { background-color: var(--success-hover); transform: translateY(-1px); }

.btn-reject {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-reject:hover { background-color: var(--danger-hover); transform: translateY(-1px); }

.comment-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.status-pending { background-color: #f1f5f9; color: #64748b; }
.status-approved { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.status-rejected { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Status Summary on Headers */
.header-status {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .slide-content-layout {
        grid-template-columns: 1fr;
    }
    header.app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    .review-actions {
        flex-direction: column;
    }
    .comment-input {
        width: 100%;
    }
}
