/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Estilos para header y footer */
header, footer {
    width: 100%;
}

/* Contenedor principal centrado */
.main-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Header section estándar - igual formato que otras páginas */
.soporte-header {
    text-align: center;
    margin: 0 0 30px 0;
    padding: 30px 0;
    border-bottom: 3px solid #42ba25;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.soporte-header h1 {
    color: #495057;
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.soporte-header p {
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
}

/* Información del usuario */
.user-info {
    background: #42ba25;
    color: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(66, 186, 37, 0.2);
    font-size: 0.95rem;
    align-self: center;
    max-width: 600px;
    width: 100%;
}

.user-info i {
    margin-right: 8px;
}


/* Layout de contenido principal - CATEGORÍAS PRIMERO */
.soporte-content {
    display: flex;
    gap: 24px;
    width: 100%;
    flex: 1;
    margin-top: 0;
    padding: 0 0 20px 0;
}

/* Sidebar con categorías - PRIMER ELEMENTO */
.soporte-sidebar {
    flex: 0 0 280px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 5px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    order: 1; /* Asegurar que aparezca primero */
}

.categorias-soporte h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f8f9fa;
}

.categorias-lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categorias-lista li {
    margin-bottom: 6px;
}

.categorias-lista a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.categorias-lista a:hover {
    background: rgba(66, 186, 37, 0.1);
    color: #42ba25;
    border-color: rgba(66, 186, 37, 0.2);
    transform: translateX(2px);
}

.categorias-lista .categoria-activa a {
    background: #42ba25;
    color: #ffffff;
    border-color: #42ba25;
    box-shadow: 0 2px 6px rgba(66, 186, 37, 0.3);
}

.categorias-lista i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Contenido principal - SEGUNDO ELEMENTO */
.soporte-main {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    min-height: 600px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    order: 2; /* Asegurar que aparezca segundo */
}

/* Secciones de contenido */
.seccion-contenido {
    padding: 24px;
    height: 100%;
}

/* CHAT STYLES */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #42ba25, #358a1f);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(66, 186, 37, 0.2);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #42ba25;
    border-radius: 3px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    animation: messageSlide 0.3s ease-out;
    word-wrap: break-word;
    margin-bottom: 4px;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensajes del usuario - Lado derecho, color azul */
.message.from-user {
    background: #e6f3fa;
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    border: 1px solid #d1ecf1;
}

/* Mensajes del agente/soporte - Lado izquierdo, color gris */
.message.from-agent {
    background: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid #dee2e6;
}

/* Compatibilidad con nombres alternativos */
.message.user {
    background: #e6f3fa;
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    border: 1px solid #d1ecf1;
}

.message.support {
    background: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid #dee2e6;
}

.message .sender-name {
    font-size: 0.75rem;
    margin-bottom: 2px;
    font-weight: bold;
    color: #666;
}

.message .message-time {
    font-size: 0.7rem;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.message .timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

/* Mensajes del sistema */
.system-message {
    align-self: center;
    background-color: #ffe6e6;
    padding: 10px 15px;
    border-radius: 10px;
    color: #333;
    text-align: center;
    font-size: 0.85rem;
    max-width: 80%;
    margin: 8px 0;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
}

.typing-indicator.active {
    display: flex;
}

.typing-indicator span {
    width: 5px;
    height: 5px;
    background: #42ba25;
    border-radius: 50%;
    animation: typing 1.5s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.3s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.chat-input {
    display: flex;
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.chat-input input:focus {
    outline: none;
    border-color: #42ba25;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(66, 186, 37, 0.1);
}

.chat-input button {
    padding: 10px 12px;
    background: #42ba25;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.chat-input button:hover {
    background: #358a1f;
    transform: scale(1.05);
}

.chat-input button:active {
    transform: scale(0.95);
}

/* Formulario de incidencias */
.contacto-content {
    padding: 0;
}

.faq-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.contacto-content > p {
    text-align: center;
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 24px;
}

.formulario-contacto {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.formulario-contacto h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #fff;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #42ba25;
    box-shadow: 0 0 0 2px rgba(66, 186, 37, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Botones */
.btn-enviar {
    background: #42ba25;
    color: white;
    border: 1px solid #42ba25;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.btn-enviar:hover {
    background: #358a1f;
    border-color: #358a1f;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 186, 37, 0.3);
}

/* Mensajes de notificación */
.notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    display: none;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    font-weight: 500;
    font-size: 0.9rem;
}

.notificacion.show {
    display: flex;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RESPONSIVE MEJORADO */
@media (max-width: 1024px) {
    .main-wrapper {
        padding: 15px;
    }
    
    .soporte-sidebar {
        flex: 0 0 250px;
    }
    
    .categorias-lista a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 10px;
    }

    .container {
        gap: 15px;
    }

    .soporte-header h1 {
        font-size: 1.8rem;
    }

    .soporte-header p {
        font-size: 0.9rem;
    }

    .user-info {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .soporte-content {
        flex-direction: column;
        gap: 15px;
    }

    .soporte-sidebar {
        flex: none;
        order: 1; /* Mantener categorías primero en móvil */
        padding: 16px;
    }

    .soporte-main {
        order: 2;
        min-height: 500px;
    }

    .seccion-contenido {
        padding: 16px;
    }

    .chat-container {
        height: 500px;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-header h3 {
        font-size: 1.1rem;
    }

    .status {
        font-size: 0.8rem;
    }

    .chat-messages {
        padding: 12px;
        gap: 10px;
    }

    .message {
        max-width: 85%;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .chat-input {
        padding: 12px;
        gap: 8px;
    }

    .chat-input input {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .chat-input button {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .categorias-lista a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .formulario-contacto {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .main-wrapper {
        padding: 8px;
    }

    .soporte-header {
        padding: 15px 0;
    }

    .soporte-header h1 {
        font-size: 1.6rem;
    }

    .user-info {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .soporte-sidebar {
        padding: 12px;
    }

    .categorias-soporte h3 {
        font-size: 1rem;
    }

    .categorias-lista a {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 8px;
    }

    .categorias-lista i {
        font-size: 0.9rem;
        width: 16px;
    }

    .seccion-contenido {
        padding: 12px;
    }

    .chat-header {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .chat-header h3 {
        font-size: 1rem;
    }

    .status {
        font-size: 0.75rem;
    }

    .chat-messages {
        padding: 10px;
    }

    .message {
        max-width: 90%;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .chat-input {
        padding: 10px;
    }

    .chat-input input {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .chat-input button {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .formulario-contacto {
        padding: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .btn-enviar {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .faq-section h2 {
        font-size: 1.5rem;
    }
}

/* Estados especiales */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.success-state {
    border-color: #28a745 !important;
    background: rgba(40, 167, 69, 0.05);
}

.error-state {
    border-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.05);
}

/* Animaciones */
.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #42ba25;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #358a1f;
}