/**
 * NexTalent - FASE 2 Features Pro CSS
 * Chat interno, modales, popup selección, material adicional
 */

/* ==========================================
   MODAL BASE
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   CHAT INTERNO
   ========================================== */

.modal-chat {
    background: var(--bg-card, #1e1e2f);
    border: 1px solid var(--border, #333);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-chat {
    transform: translateY(0);
}

.modal-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border, #333);
}

.modal-chat-header h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-chat-header h3 i {
    color: var(--gold, #D4AF37);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-elevated, #252538);
    color: var(--text, #fff);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(212, 175, 55, 0.2);
    color: var(--gold, #D4AF37);
}

.modal-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
}

.chat-loading,
.chat-empty,
.chat-error {
    text-align: center;
    color: var(--text-muted, #666);
    padding: 2rem;
}

.chat-empty i {
    font-size: 2rem;
    opacity: 0.3;
    margin-bottom: 0.5rem;
    display: block;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-message.invitado .chat-avatar {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold, #D4AF37), #b8860b);
    color: var(--bg-primary, #1a1a2e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.chat-content {
    flex: 1;
    min-width: 0;
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.chat-author {
    font-weight: 600;
    font-size: 0.85rem;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
}

.chat-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-secondary, #aaa);
}

.chat-text .mention {
    color: var(--gold, #D4AF37);
    font-weight: 500;
}

.modal-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border, #333);
}

.modal-chat-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated, #252538);
    border: 1px solid var(--border, #333);
    border-radius: 24px;
    color: var(--text, #fff);
    font-size: 0.9rem;
}

.modal-chat-input input:focus {
    outline: none;
    border-color: var(--gold, #D4AF37);
}

.modal-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-gold, linear-gradient(135deg, #D4AF37, #b8860b));
    color: var(--bg-primary, #1a1a2e);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.modal-chat-input button:hover {
    transform: scale(1.1);
}

/* ==========================================
   POPUP SELECCIÓN
   ========================================== */

.modal-seleccion {
    background: var(--bg-card, #1e1e2f);
    border: 1px solid var(--border, #333);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-seleccion {
    transform: scale(1);
}

.modal-seleccion-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 1.5rem;
    animation: pulse-success 1s ease-out;
}

@keyframes pulse-success {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-seleccion h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-seleccion h3 span {
    color: var(--gold, #D4AF37);
}

.modal-seleccion p {
    color: var(--text-muted, #666);
    margin-bottom: 1.5rem;
}

.modal-seleccion-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.modal-seleccion-actions .btn-action {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border, #333);
    background: var(--bg-elevated, #252538);
    color: var(--text, #fff);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.modal-seleccion-actions .btn-action i {
    font-size: 1.25rem;
    color: var(--gold, #D4AF37);
}

.modal-seleccion-actions .btn-action:hover {
    border-color: var(--gold, #D4AF37);
    transform: translateY(-2px);
}

.modal-seleccion-actions .btn-whatsapp {
    border-color: #25D366;
}

.modal-seleccion-actions .btn-whatsapp i {
    color: #25D366;
}

.modal-seleccion-actions .btn-whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
}

.modal-seleccion .btn-cerrar {
    background: none;
    border: none;
    color: var(--text-muted, #666);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.modal-seleccion .btn-cerrar:hover {
    color: var(--text, #fff);
}

/* ==========================================
   MATERIAL ADICIONAL
   ========================================== */

.modal-material {
    background: var(--bg-card, #1e1e2f);
    border: 1px solid var(--border, #333);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-material-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border, #333);
}

.modal-material-header h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-material-header h3 i {
    color: var(--gold, #D4AF37);
}

.modal-material-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-material-body .selected-count {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.modal-material-body .selected-count strong {
    color: var(--gold, #D4AF37);
}

.modal-material-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-material-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary, #aaa);
}

.modal-material-body select,
.modal-material-body input,
.modal-material-body textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated, #252538);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    color: var(--text, #fff);
    font-size: 0.9rem;
}

.modal-material-body textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-material-body select:focus,
.modal-material-body input:focus,
.modal-material-body textarea:focus {
    outline: none;
    border-color: var(--gold, #D4AF37);
}

.modal-material-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border, #333);
}

/* ==========================================
   BOTONES ADICIONALES EN CARDS
   ========================================== */

.btn-chat {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.btn-chat:hover {
    background: rgba(52, 152, 219, 0.25);
}

.btn-chat .badge {
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

.btn-material {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.btn-material:hover {
    background: rgba(155, 89, 182, 0.25);
}

/* ==========================================
   INDICADORES DE MATERIAL
   ========================================== */

.material-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.material-badge.pendiente {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.material-badge.enviado {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.material-badge.aprobado {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 600px) {
    .modal-seleccion-actions {
        flex-direction: column;
    }

    .modal-seleccion-actions .btn-action {
        flex-direction: row;
        justify-content: center;
    }

    .modal-chat,
    .modal-material {
        max-height: 100vh;
        border-radius: 0;
    }
}
