/* QA Comments - Estilos similares a Analytics */

/* Login Screen */
.qa-login-overlay {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 350px;
    max-width: 95vw;
    animation: fadeIn 0.3s ease-in-out;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qa-login-card h2 {
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1.8rem;
    text-align: center;
    color: #333;
}

.login-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 25px;
    text-align: center;
}

.qa-password-input {
    padding: 12px 18px;
    border-radius: 30px;
    border: 1px solid #ddd;
    width: 100%;
    margin-bottom: 20px;
    font-size: 1.1rem;
    transition: border-color 0.3s;
}

.qa-password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.qa-login-btn {
    background: #667eea;
    color: white;
    padding: 12px 36px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.qa-login-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.login-error {
    color: #d32f2f;
    margin-top: 12px;
    font-size: 0.9rem;
    animation: shake 0.3s;
}

.session-info {
    margin-top: 15px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.back-to-chat {
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.back-to-chat:hover {
    color: #5568d3;
}

/* Dashboard Principal */
.qa-dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.qa-main-content {
    width: calc(100% - 70px);
    margin-left: 70px;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
    overflow-y: auto;
    position: relative;
}

/* Header */
.qa-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e6ed;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.qa-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.qa-header h1 i {
    color: #667eea;
}

.last-update-indicator {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 15px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
}

.header-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.header-btn i {
    font-size: 1rem;
}

/* Controles y búsqueda */
.qa-controls {
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 15px;
    color: #7f8c8d;
    font-size: 1rem;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    border: 2px solid #e0e6ed;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: #37474f;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #263238;
    transform: scale(1.1);
}

.stats-summary {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #555;
    padding: 8px 16px;
    background: #f5f7fa;
    border-radius: 20px;
}

.stat-item i {
    color: #667eea;
}

.stat-item span {
    font-weight: 600;
    color: #2c3e50;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e6ed;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Contenedor de comentarios */
.comments-container {
    padding: 20px 30px;
}

.comments-list {
    display: grid;
    gap: 15px;
}

/* Tarjeta de comentario */
.comment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #667eea;
    transition: all 0.3s;
    animation: fadeInUp 0.3s ease-in-out;
    position: relative; /* Necesario para posicionar el botón de modo Dios */
}

.comment-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.comment-phone {
    display: flex;
    align-items: center;
    gap: 10px;
}

.phone-link {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.phone-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.phone-link i {
    font-size: 1rem;
}

.comment-timestamp {
    color: #7f8c8d;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.comment-body {
    color: #2c3e50;
    line-height: 1.6;
    font-size: 0.95rem;
    padding: 12px 0;
    border-top: 1px solid #f0f2f5;
}

.comment-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f2f5;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: transparent;
    border: 1px solid #e0e6ed;
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Estado vacío */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #7f8c8d;
}

.empty-state i {
    font-size: 4rem;
    color: #e0e6ed;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-state p {
    color: #7f8c8d;
}

/* Error container */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.error-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.error-card i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.error-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.retry-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .qa-main-content {
        width: calc(100% - 60px);
        margin-left: 60px;
    }

    .qa-header {
        padding: 15px 20px;
    }

    .qa-header h1 {
        font-size: 1.4rem;
    }

    .last-update-indicator {
        display: none;
    }

    .header-btn span {
        display: none;
    }

    .qa-controls {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .stats-summary {
        justify-content: center;
    }

    .comments-container {
        padding: 15px 20px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============================================================
   GOD MODE - Modo administrador local para QA
   ============================================================ */

.god-mode-hide-btn-qa {
    position: absolute;
    right: 10px;
    top: 10px;
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0.8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.god-mode-hide-btn-qa:hover {
    opacity: 1;
    background: #f44336;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.comment-card.hidden-comment {
    opacity: 0.5;
    background: #f5f5f5 !important;
    border-left-color: #999 !important;
}

.comment-card.hidden-comment .comment-body {
    text-decoration: line-through;
    color: #999;
}

.comment-card.hidden-comment .phone-link {
    color: #999 !important;
    text-decoration: line-through;
}

@media (max-width: 480px) {
    .qa-main-content {
        width: calc(100% - 50px);
        margin-left: 50px;
    }

    .qa-login-card {
        padding: 30px 24px;
        min-width: 300px;
    }

    .stat-item {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}
