/* Estilos para el sistema de votación de casos clínicos */

/* Contenedor principal del formulario de votación */
.neuropci-clinical-vote-container {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    max-width: 600px;
}

.neuropci-clinical-vote-container h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Formulario de votación */
.neuropci-vote-form .description {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

.aspect-rating {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.aspect-rating label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.aspect-rating .weight {
    color: #666;
    font-weight: normal;
    font-size: 0.9em;
}

.aspect-description {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0 15px 0;
    line-height: 1.4;
}

/* Sistema de rating con sliders (0-10) */
.rating-input-container {
    margin: 15px 0;
}

.rating-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.rating-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

.rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rating-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0073aa;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.rating-slider:hover::-webkit-slider-thumb {
    background: #005a87;
    transform: scale(1.1);
}

.rating-slider:hover::-moz-range-thumb {
    background: #005a87;
    transform: scale(1.1);
}

.rating-slider:focus {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.rating-slider.rating-changed {
    background: linear-gradient(to right, #0073aa 0%, #00a0d2 100%);
}

.rating-value-display {
    min-width: 80px;
    text-align: center;
}

.rating-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #0073aa;
}

.rating-scale {
    color: #666;
    font-size: 0.9em;
}

.rating-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.rating-scale-labels .scale-min {
    color: #dc3232;
}

.rating-scale-labels .scale-mid {
    color: #ffb900;
}

.rating-scale-labels .scale-max {
    color: #46b450;
}
}

/* Sistema de estrellas */
.rating-stars {
    margin: 10px 0;
}

.rating-stars .star {
    display: inline-block;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-right: 5px;
}

.rating-stars .star:hover,
.rating-stars .star.active {
    color: #ffc107;
}

.rating-stars .star.filled {
    color: #ffc107;
}

/* Acciones del formulario */
.vote-actions {
    text-align: center;
    margin-top: 20px;
}

.neuropci-submit-vote {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.neuropci-submit-vote:hover {
    background: #005a87;
}

.vote-loading {
    color: #666;
    font-style: italic;
}

/* Voto ya registrado */
.neuropci-vote-already-cast {
    text-align: center;
    padding: 20px;
    background: #e7f4e4;
    border-radius: 5px;
    border-left: 4px solid #46b450;
}

.neuropci-vote-already-cast .score {
    font-weight: bold;
    color: #46b450;
    font-size: 1.2em;
}

/* Resultados de votación */
.neuropci-vote-results {
    margin-top: 25px;
    padding: 15px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.neuropci-vote-results h4 {
    margin-top: 0;
    color: #333;
}

.results-summary {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 5px;
}

.overall-score .score,
.total-votes .count {
    font-weight: bold;
    color: #0073aa;
}

.aspects-breakdown {
    margin-top: 15px;
}

.aspect-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 3px;
}

.aspect-name {
    font-weight: bold;
    flex: 1;
}

.aspect-score {
    color: #0073aa;
    font-weight: bold;
    margin-right: 10px;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #46b450, #0073aa);
    transition: width 0.3s ease;
}

/* Listas de posts */
.neuropci-voted-posts,
.neuropci-unvoted-posts {
    margin: 20px 0;
}

.neuropci-voted-posts h3,
.neuropci-unvoted-posts h3 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.posts-list {
    margin-top: 15px;
}

.voted-post-item,
.unvoted-post-item {
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.voted-post-item h4,
.unvoted-post-item h4 {
    margin: 0 0 10px 0;
}

.voted-post-item h4 a,
.unvoted-post-item h4 a {
    text-decoration: none;
    color: #0073aa;
}

.voted-post-item h4 a:hover,
.unvoted-post-item h4 a:hover {
    text-decoration: underline;
}

.vote-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
}

.your-score {
    font-weight: bold;
    color: #46b450;
}

.post-excerpt {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.vote-action .vote-now-btn {
    background: #46b450;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.vote-action .vote-now-btn:hover {
    background: #3e8b40;
}

/* Resultados detallados */
.neuropci-vote-results-display {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.results-header h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.overall-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 5px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
}

.stat-value {
    display: block;
    font-weight: bold;
    font-size: 1.2em;
    color: #0073aa;
}

.stat-value.highlight {
    color: #46b450;
    font-size: 1.5em;
}

.detailed-results h4 {
    margin: 20px 0 15px 0;
    color: #333;
}

.aspect-detailed-result {
    margin-bottom: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.aspect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.aspect-weight {
    color: #666;
    font-size: 0.9em;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-container .progress-bar {
    flex: 1;
    height: 10px;
}

.percentage {
    font-weight: bold;
    color: #0073aa;
    min-width: 50px;
    text-align: right;
}

/* Ranking */
.neuropci-posts-ranking {
    margin: 20px 0;
}

.neuropci-posts-ranking h3 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

.ranking-list {
    margin-top: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.rank-number {
    background: #0073aa;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.post-info {
    flex: 1;
}

.post-info h4 {
    margin: 0 0 8px 0;
}

.post-info h4 a {
    text-decoration: none;
    color: #0073aa;
}

.post-info h4 a:hover {
    text-decoration: underline;
}

.post-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.post-stats .score {
    color: #46b450;
    font-weight: bold;
}

/* Mensajes de error y información */
.neuropci-error {
    background: #fff2f2;
    border-left: 4px solid #dc3232;
    padding: 12px;
    margin: 10px 0;
    color: #dc3232;
}

.neuropci-no-posts,
.neuropci-no-data {
    background: #fff8e1;
    border-left: 4px solid #ffb900;
    padding: 12px;
    margin: 10px 0;
    color: #8b6914;
}

.neuropci-legacy {
    background: #e1f5fe;
    border-left: 4px solid #0073aa;
    padding: 12px;
    margin: 10px 0;
    color: #0073aa;
}

/* Auto-formulario agregado al contenido */
.neuropci-auto-vote-form {
    margin: 30px 0;
    border-top: 2px solid #ddd;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .neuropci-clinical-vote-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .overall-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .aspect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rank-number {
        align-self: flex-start;
    }
    
    .vote-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .post-stats {
        flex-direction: column;
        gap: 5px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.neuropci-clinical-vote-container {
    animation: fadeIn 0.5s ease;
}

.vote-loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Estados de hover para mejor UX */
.voted-post-item:hover,
.unvoted-post-item:hover,
.ranking-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* Estilos para votación existente */
.neuropci-vote-existing {
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
}

.neuropci-vote-existing h3 {
    color: #0073aa;
    margin-top: 0;
    display: flex;
    align-items: center;
}

.neuropci-vote-existing h3:before {
    content: "✓";
    background: #0073aa;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 14px;
}

.current-votes-display {
    margin: 20px 0;
}

.aspect-score-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.aspect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.aspect-header strong {
    color: #333;
    font-size: 16px;
}

.aspect-header .weight {
    color: #666;
    font-size: 14px;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

.score-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-value {
    min-width: 50px;
    font-weight: bold;
    font-size: 18px;
    color: #0073aa;
}

.score-bar-bg {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.total-score {
    background: #0073aa;
    color: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-top: 20px;
}

.total-score strong {
    font-size: 20px;
    display: block;
    margin-bottom: 5px;
}

.total-score small {
    opacity: 0.8;
    font-size: 13px;
}

.vote-actions {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.vote-actions .button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
}

.vote-actions .button:hover {
    background: #005177;
    color: white;
}

/* Modo edición */
.neuropci-vote-form .notice {
    margin: 0 0 20px 0;
    padding: 12px;
    border-left: 4px solid #0073aa;
    background: #f0f6fc;
}

.neuropci-vote-form .notice p {
    margin: 0;
    color: #0073aa;
}

/* Progreso del comité */
.committee-progress {
    margin-top: 10px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.committee-progress .label {
    font-weight: bold;
    color: #0073aa;
}

.committee-progress .progress {
    font-weight: bold;
    margin-left: 10px;
}

.committee-progress .status {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.committee-progress .status.achieved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.committee-progress .status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive */
@media (max-width: 768px) {
    .aspect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .score-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .score-value {
        text-align: center;
    }
    
    .committee-progress {
        padding: 8px;
    }
    
    .committee-progress .label,
    .committee-progress .progress,
    .committee-progress .status.pending {
        display: block;
        margin: 2px 0;
    }
}

/* Información del comité en listados */
.committee-info-small {
    margin: 5px 0;
    padding: 5px 10px;
    background: #f0f8ff;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
}

.committee-info-small small {
    color: #0073aa !important;
    font-style: italic;
    display: block;
}

/* Estilos para listados de posts */
.voted-post-item,
.unvoted-post-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
}

.voted-post-item h4,
.unvoted-post-item h4 {
    margin: 0 0 10px 0;
}

.vote-info {
    margin: 10px 0;
}

.vote-info span {
    display: inline-block;
    margin-right: 15px;
    font-size: 14px;
}

.your-score {
    font-weight: bold;
    color: #0073aa;
}

.vote-date {
    color: #666;
}

.vote-now-btn {
    display: inline-block;
    padding: 8px 15px;
    background: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    transition: background 0.3s;
}

.vote-now-btn:hover {
    background: #005a87;
    color: white;
}

/* Estilos para el ranking del comité */
.neuropci-posts-ranking {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.ranking-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 10px;
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    transition: box-shadow 0.3s;
}

.ranking-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rank-number {
    background: #0073aa;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ranking-item:nth-child(1) .rank-number {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
}

.ranking-item:nth-child(2) .rank-number {
    background: linear-gradient(45deg, #c0c0c0, #e5e5e5);
    color: #333;
}

.ranking-item:nth-child(3) .rank-number {
    background: linear-gradient(45deg, #cd7f32, #deb887);
    color: white;
}

.post-info {
    flex: 1;
}

.post-info h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.post-info h4 a {
    text-decoration: none;
    color: #0073aa;
}

.post-info h4 a:hover {
    text-decoration: underline;
}

.post-stats {
    margin-bottom: 8px;
}

.post-stats span {
    display: inline-block;
    margin-right: 20px;
    font-size: 14px;
}

.post-stats .score {
    font-weight: bold;
    color: #0073aa;
}

.post-stats .votes {
    color: #666;
}

.committee-progress-ranking {
    margin-top: 5px;
}

.committee-progress-ranking small {
    color: #666;
    font-style: italic;
}

/* Responsive para ranking */
@media (max-width: 768px) {
    .ranking-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .rank-number {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .post-stats span {
        display: block;
        margin: 5px 0;
    }
}

/* Estilos para la sección de mantenimiento en el admin */
.maintenance-section {
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin: 20px 0;
    padding: 20px;
    border-radius: 4px;
}

.maintenance-section h2 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.maintenance-tools {
    margin-top: 15px;
}

.maintenance-tools .button {
    margin-right: 10px;
}

.maintenance-tools .description {
    margin-top: 10px;
    color: #666;
    font-style: italic;
    max-width: 600px;
}