/* Estilos para Pop-up de Colaboración */
.collaboration-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.collaboration-popup {
    background: #fff;
    border: 2px solid #000;
    border-radius: 0;
    padding: 0;
    max-width: 1000px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 8px 8px 0 #000;
    animation: slideIn 0.4s ease-out;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    flex-direction: column;
}

/* Estilos para scrollbar */
.collaboration-popup::-webkit-scrollbar {
    width: 12px;
}

.collaboration-popup::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-left: 2px solid #000;
}

.collaboration-popup::-webkit-scrollbar-thumb {
    background: #000;
    border: 1px solid #fff;
}

.collaboration-popup::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.popup-content::-webkit-scrollbar {
    width: 8px;
}

.popup-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.popup-content::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 0;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.popup-header {
    background: #000;
    color: #fff;
    padding: 20px 30px;
    text-align: center;
    position: relative;
    border-bottom: 2px solid #000;
}

.popup-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.5px;
}

.popup-header p {
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
    font-family: 'JetBrains Mono', monospace;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #fff;
    border: 2px solid #fff;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
}

.close-popup:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.popup-content {
    padding: 25px 30px 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(95vh - 120px); /* Restar altura del header */
}

/* Mejorar la organización del contenido */
.popup-intro {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.collaboration-benefits {
    align-self: start;
}

.collaboration-form {
    align-self: start;
}

@media (max-width: 768px) {
    .popup-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
        max-height: calc(98vh - 80px); /* Maximizar espacio en móviles */
    }
    
    .collaboration-popup {
        max-width: 98%;
        width: 98%;
        max-height: 98vh;
        margin: 1vh;
    }
    
    .collaboration-popup-overlay {
        align-items: flex-start;
        padding: 1vh 1vw;
    }
    
    .popup-header {
        padding: 15px 20px;
    }
    
    .popup-header h2 {
        font-size: 1.4rem;
    }
    
    .popup-content::after {
        font-size: 0.7rem;
        padding: 6px 12px;
        bottom: 5px;
    }
}

.popup-intro {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 25px;
}

/* Indicador de scroll */
.popup-content::after {
    content: '⬇️ Desplázate para ver más contenido';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    animation: bounce 1s infinite;
}

.popup-content.scrollable::after {
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-5px);
    }
    60% {
        transform: translateX(-50%) translateY(-3px);
    }
}

/* Mejorar la visibilidad del contenido */
.popup-content {
    position: relative;
}

.popup-intro h3 {
    color: #000;
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
}

.popup-intro p {
    color: #000;
    line-height: 1.6;
    margin-bottom: 15px;
    font-family: 'JetBrains Mono', monospace;
}

.collaboration-benefits {
    background: #f0f0f0;
    border: 2px solid #000;
    padding: 20px;
    margin-bottom: 25px;
}

.collaboration-benefits h4 {
    color: #000;
    font-size: 1.1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
}

.collaboration-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.collaboration-benefits li {
    padding: 5px 0;
    color: #000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.collaboration-benefits li::before {
    content: "✓";
    background: #000;
    color: #fff;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.collaboration-form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: #000;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #000;
    border-radius: 0;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    background: white;
    min-height: 44px; /* Tamaño táctil adecuado */
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: 4px 4px 0 #ccc;
}

.form-group input.required,
.form-group select.required {
    border-left: 4px solid #000;
}

.form-group input.required:focus,
.form-group select.required:focus {
    border-left-color: #000;
}

.especialidades-select {
    position: relative;
}

.especialidades-select select {
    width: 100%;
}

.popup-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.btn-colaborar {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 15px 40px;
    border-radius: 0;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    font-family: 'JetBrains Mono', monospace;
}

.btn-colaborar:hover {
    background: #fff;
    color: #000;
    box-shadow: 4px 4px 0 #ccc;
}

.btn-colaborar:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-maybe-later {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 15px 25px;
    border-radius: 0;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
}

.btn-maybe-later:hover {
    background: #000;
    color: #fff;
}

.privacy-note {
    margin-top: 20px;
    padding: 20px;
    background: #f0f0f0;
    border: 2px solid #000;
    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
}

.privacy-note.full-width {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 25px;
}

.privacy-note p {
    margin: 0;
    font-size: 0.9rem;
    color: #000;
    line-height: 1.6;
    text-align: justify;
    font-family: 'JetBrains Mono', monospace;
}

.privacy-note strong {
    color: #000;
    font-weight: bold;
}

.privacy-note a {
    color: #3498db;
    text-decoration: none;
}

.privacy-note a:hover {
    text-decoration: underline;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .collaboration-popup {
        width: 95%;
        margin: 20px;
    }
    
    .popup-header {
        padding: 20px 25px;
    }
    
    .popup-header h2 {
        font-size: 1.5rem;
    }
    
    .popup-content {
        padding: 25px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .btn-colaborar {
        flex: none;
        width: 100%;
        min-height: 48px; /* Botón extra grande en móvil */
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .collaboration-popup {
        width: 98%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .popup-content {
        padding: 20px 15px;
    }
    
    .collaboration-benefits {
        padding: 15px;
    }
    
    .popup-header h2 {
        font-size: 1.3rem;
    }
}

/* Estados de validación */
.form-group.error input,
.form-group.error select {
    border-color: #e74c3c;
    animation: shake 0.3s ease-in-out;
}

.form-group.success input,
.form-group.success select {
    border-color: #2ecc71;
}

.error-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading state */
.btn-colaborar.loading {
    position: relative;
    color: transparent;
}

.btn-colaborar.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== SECCIÓN DE ADMINISTRACIÓN ===== */
.admin-section {
    grid-column: 1 / -1;
    margin-top: 20px;
    padding: 20px;
    background: #f0f0f0;
    border: 2px solid #000;
    border-top: 4px solid #000;
}

.admin-divider {
    height: 2px;
    background: #000;
    margin: 0 0 15px 0;
}

.admin-section h4 {
    color: #000;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    text-align: center;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 15px;
}

.btn-admin {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
    flex: 1;
    min-width: 180px;
}

.btn-admin:hover {
    background: #000;
    color: #fff;
    box-shadow: 2px 2px 0 #ccc;
}

.btn-admin.danger {
    border-color: #cc0000;
    color: #cc0000;
}

.btn-admin.danger:hover {
    background: #cc0000;
    color: #fff;
}

.stats-display {
    background: #fff;
    border: 2px solid #000;
    padding: 15px;
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
}

.stats-display h5 {
    color: #000;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.stats-display ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.stats-display li {
    padding: 2px 0;
    color: #000;
}

@media (max-width: 768px) {
    .admin-actions {
        flex-direction: column;
    }
    
    .btn-admin {
        min-width: auto;
    }
}