:root {
    --primary: #4A6FA5;
    --primary-dark: #2E4A76;
    --secondary: #FF9A3C;
    --secondary-dark: #E67E22;
    --accent: #6BCF7F;
    --conductor-color: #9B59B6;
    --right-color: #3498DB;
    --left-color: #E74C3C;
    --light: #F8F9FA;
    --dark: #2C3E50;
    --gray: #6C757D;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 20px;
    margin-bottom: 25px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h2 {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    margin-bottom: 15px;
}

.header-icon {
    font-size: 1.8rem;
    margin-right: 12px;
    vertical-align: middle;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.legend-color.conductor {
    background-color: var(--conductor-color);
}

.legend-color.right {
    background-color: var(--right-color);
}

.legend-color.left {
    background-color: var(--left-color);
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    background-color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 0 15px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 5px;
}

/* Estilo de tabla para desktop */
.participants-table {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.table-header {
    display: grid;
    grid-template-columns: 80px 120px 1.5fr 2fr 180px 180px;
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 120px 1.5fr 2fr 180px 180px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
    position: relative;
}

.table-row.conductor .question {
    color: #9B59B6; /* MISMO COLOR MORADO que el borde conductor */
    border-left: 3px solid #9B59B6;
    background-color: rgba(155, 89, 182, 0.08);
    font-style: italic;
}


.table-row.conductor .replacement-info {
    display: none;
}

.table-row.right-side .question {
    color: #3498DB; /* MISMO COLOR CELESTE que el borde derecho */
    border-left: 3px solid #3498DB;
    background-color: rgba(52, 152, 219, 0.08);
}

.table-row.left-side .question {
    color: #E74C3C; /* MISMO COLOR ROJO que el borde izquierdo */
    border-left: 3px solid #E74C3C;
    background-color: rgba(231, 76, 60, 0.08);
}

.table-row.right-side .replacement-info {
    color: #3498DB; /* MISMO COLOR CELESTE que el borde derecho */
    border-left: 3px solid #3498DB;
    background-color: rgba(52, 152, 219, 0.08);
}

.table-row.left-side .replacement-info {
    color: #E74C3C; /* MISMO COLOR ROJO que el borde izquierdo */
    border-left: 3px solid #E74C3C;
    background-color: rgba(231, 76, 60, 0.08);
}

.table-row:hover {
    background-color: #f8f9fa;
}

.participant-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.conductor .participant-number {
    font-size: 1.5rem;
    color: var(--conductor-color);
}

.right-side .participant-number {
    color: var(--right-color);
}

.left-side .participant-number {
    color: var(--left-color);
}

.participant-paragraph-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.conductor .participant-paragraph-cell {
    color: var(--conductor-color);
    font-size: 0.8rem;
}

.participant-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.participant-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
    word-break: break-word;
}

.conductor .participant-name {
    font-size: 1rem;
    color: var(--conductor-color);
    font-weight: 700;
}

.participant-side {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.right-side .participant-side {
    background-color: rgba(52, 152, 219, 0.2);
    color: var(--right-color);
}

.left-side .participant-side {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--left-color);
}

.conductor .participant-side {
    background-color: rgba(155, 89, 182, 0.2);
    color: var(--conductor-color);
}

.question {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    padding: 10px 12px;
    word-break: break-word;
    line-height: 1.4;
    border-radius: 4px;
    margin: 4px 0;
}

.conductor .question {
    color: var(--conductor-color);
    font-style: italic;
}

.replacement-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 4px;
    margin: 4px 0;
}

.replacement-label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.replacement-name {
    font-style: italic;
    word-break: break-word;
    font-size: 0.9rem;
}

.table-row.right-side .replacement-label,
.table-row.right-side .replacement-name {
    color: #3498DB; /* Celeste para lado derecho */
}

.table-row.left-side .replacement-label,
.table-row.left-side .replacement-name {
    color: #E74C3C; /* Rojo para lado izquierdo */
}

.photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 8px;
}

.photo-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.empty-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: var(--gray);
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.empty-photo i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #adb5bd;
}

.upload-btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.upload-btn:hover {
    background-color: #5abf6f;
    transform: translateY(-2px);
}

.upload-input {
    display: none;
}

.uploading {
    opacity: 0.7;
    pointer-events: none;
}

/* Controles flotantes */
.floating-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.floating-btn:hover {
    transform: translateY(-5px);
}

/* Modal para foto grande */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    padding: 25px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--dark);
}

.modal-photo {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-name {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.modal-paragraph {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.modal-question {
    font-size: 1.1rem;
    color: var(--gray);
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid #eee;
}

.footer-logo {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 8px;
}

/* =========================================== */
/* DISEÑO RESPONSIVO MEJORADO */
/* =========================================== */

/* Pantallas grandes (≥1200px) - ya definido arriba */

/* Pantallas medianas (992px - 1199px) */
@media (max-width: 1199px) {
    .table-header,
    .table-row {
        grid-template-columns: 70px 100px 1.2fr 1.8fr 150px 140px;
        padding: 12px 15px;
    }
    
    .participant-number {
        font-size: 1.6rem;
    }
    
    .participant-paragraph-cell {
        font-size: 0.85rem;
    }
    
    .question {
        font-size: 0.85rem;
    }
}

/* Tablets (768px - 991px) */
@media (max-width: 991px) {
    .table-header {
        display: none;
    }
    
    .participants-table {
        display: block;
    }
    
    .table-row {
        display: flex;
        flex-direction: column;
        padding: 15px;
        margin-bottom: 10px;
        border-radius: var(--border-radius);
        border: 1px solid #eee;
        position: relative;
        min-height: 120px;
    }
    
    .participant-number {
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 1.6rem;
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .participant-paragraph-cell {
        position: absolute;
        top: 15px;
        left: 15px;
        font-size: 1rem;
        font-weight: 700;
        background: rgba(255, 255, 255, 0.9);
        padding: 4px 8px;
        border-radius: 6px;
        min-width: 50px;
        text-align: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .participant-info {
        margin-top: 40px;
        margin-bottom: 10px;
    }
    
    .participant-name {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .question {
        margin-bottom: 15px;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 6px;
        border-left: 3px solid var(--accent);
    }
    
    .replacement-info {
        margin-bottom: 15px;
        padding: 8px;
        background: #f8f9fa;
        border-radius: 6px;
        border-left: 3px solid #6c757d;
    }
    
    .photo-section {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed #ddd;
        width: 100%;
    }
    
    .floating-controls {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Móviles grandes (576px - 767px) */
@media (max-width: 767px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header h2 {
        font-size: 1rem;
    }
    
    .legend {
        flex-direction: column;
        gap: 8px;
    }
    
    .legend-item {
        justify-content: center;
        font-size: 0.8rem;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .stat-item {
        padding: 5px 0;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .table-row {
        padding: 12px;
        min-height: 110px;
    }
    
    .participant-number {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }
    
    .participant-paragraph-cell {
        top: 10px;
        left: 10px;
        font-size: 0.9rem;
        min-width: 45px;
    }
    
    .participant-info {
        margin-top: 35px;
    }
    
    .participant-name {
        font-size: 1rem;
    }
    
    .question {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    .replacement-info {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .photo-preview {
        width: 50px;
        height: 50px;
    }
    
    .empty-photo {
        width: 50px;
        height: 50px;
    }
    
    .upload-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Móviles pequeños (≤575px) */
@media (max-width: 575px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-icon {
        font-size: 1.3rem;
    }
    
    .table-row {
        padding: 10px;
    }
    
    .participant-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .participant-paragraph-cell {
        font-size: 0.8rem;
        min-width: 40px;
        padding: 3px 6px;
    }
    
    .participant-name {
        font-size: 0.95rem;
    }
    
    .participant-side {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .question {
        font-size: 0.8rem;
    }
    
    .replacement-info {
        font-size: 0.75rem;
    }
    
    .photo-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }
    
    .photo-preview, .empty-photo {
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .floating-controls {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Pantallas muy pequeñas (≤360px) */
@media (max-width: 360px) {
    .participant-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .participant-paragraph-cell {
        min-width: 35px;
        font-size: 0.75rem;
    }
    
    .participant-info {
        margin-top: 30px;
    }
    
    .photo-preview, .empty-photo {
        width: 45px;
        height: 45px;
    }
}