* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2d3748 100%);
    min-height: 100vh;
    color: #1a202c;
    overflow-x: hidden;
    letter-spacing: 0.3px;
}

/* ===== Wrapper y Header ===== */
.soporte-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

.soporte-header {
    background: linear-gradient(to right, #1a365d, #2d3748, #1a365d);
    backdrop-filter: blur(20px);
    padding: 1.75rem 2rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-info h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: 0;
    font-weight: 400;
}

/* ===== Contenedor principal ===== */
.soporte-container {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 2.5rem 1.5rem;
}

.panel-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 3rem;
    animation: slideInUp 0.5s ease;
    min-height: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.panel-content.hidden {
    display: none;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Panel inicial ===== */
.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.icon-welcome {
    font-size: 5rem;
    margin-bottom: 2rem;
    color: #1a365d;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(26, 54, 93, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.welcome-section h2 {
    font-size: 2.2rem;
    color: #1a202c;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.welcome-section > p {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 550px;
    line-height: 1.6;
    font-weight: 400;
}

.info-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
    width: 100%;
}

.stat {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 1.75rem 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(26, 54, 93, 0.15);
    border-color: #cbd5e0;
}

.stat-number {
    font-size: 2.2rem;
}

.stat-text {
    color: #2d3748;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.text-helper {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 1rem;
    font-weight: 400;
}

/* ===== Botones ===== */
.btn-primary {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(26, 54, 93, 0.3);
    letter-spacing: 0.3px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(26, 54, 93, 0.4);
    background: linear-gradient(135deg, #0f172a 0%, #1a365d 100%);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-large {
    padding: 1.1rem 3rem;
    font-size: 1.1rem;
}

.btn-close-ticket {
    background: linear-gradient(135deg, #c53030 0%, #742a2a 100%);
    color: white;
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(197, 48, 48, 0.25);
}

.btn-close-ticket:hover {
    background: linear-gradient(135deg, #a02622 0%, #5a1a1a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(197, 48, 48, 0.3);
}

/* ===== Panel Chat ===== */
#panel-chat {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.ticket-status {
    background: linear-gradient(to right, #f7fafc, #edf2f7);
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    color: #276749;
}

.badge-dot {
    width: 10px;
    height: 10px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
}

.badge-dot.active {
    background: #38a169;
    box-shadow: 0 0 8px rgba(56, 161, 105, 0.6), inset 0 0 3px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#status-text {
    color: #2d3748;
    font-size: 0.95rem;
    font-weight: 600;
}

.ticket-info {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
}

/* ===== Chat Box ===== */
.chat-box {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: linear-gradient(to bottom, #fafbfc, #f7fafc);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 55vh;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
    scroll-behavior: smooth;
}

.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
    border: 2px solid #f7fafc;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1.5rem;
    color: #718096;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #1a365d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: inset 0 0 6px rgba(26, 54, 93, 0.1);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chat-bubble {
    display: inline-block;
    max-width: 75%;
    padding: 1rem 1.35rem;
    border-radius: 16px;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: chatBubbleIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@keyframes chatBubbleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-bubble.robot {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    align-self: flex-start;
    box-shadow: 0 4px 16px rgba(26, 54, 93, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-bubble.user {
    background: #e6f2ff;
    color: #1a202c;
    align-self: flex-end;
    box-shadow: 0 2px 10px rgba(26, 54, 93, 0.12);
    border: 1px solid rgba(26, 54, 93, 0.1);
}

.chat-bubble-time {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 0.35rem;
    display: block;
}

.chat-bubble.robot .chat-bubble-time {
    opacity: 0.85;
}

/* ===== Indicador de escribiendo ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    align-self: flex-start;
    color: #2d3748;
    font-size: 0.9rem;
    font-style: italic;
    font-weight: 500;
}

.typing-indicator.hidden {
    display: none;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #2c5282;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ===== Input Bar ===== */
.chat-input-bar {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    resize: none;
    max-height: 100px;
    color: #2d3748;
    background: #f7fafc;
}

.chat-input::placeholder {
    color: #a0aec0;
}

.chat-input:focus {
    border-color: #2c5282;
    box-shadow: 0 0 0 4px rgba(44, 82, 130, 0.1);
    background: white;
}

.chat-input:disabled {
    background: #edf2f7;
    cursor: not-allowed;
    border-color: #cbd5e0;
}

.send-btn {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.2);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 18px rgba(26, 54, 93, 0.3);
    background: linear-gradient(135deg, #0f172a 0%, #1a365d 100%);
}

.send-btn:active:not(:disabled) {
    transform: scale(1.03) translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== Chat Footer ===== */
.chat-footer {
    padding: 1.25rem 1.75rem;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: white;
    padding: 1.1rem 1.75rem;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 380px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
    font-weight: 500;
    font-size: 0.95rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(400px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-left-color: #38a169;
    color: #22543d;
}

.toast-error {
    border-left-color: #c53030;
    color: #742a2a;
}

.toast-info {
    border-left-color: #2c5282;
    color: #1a365d;
}

/* ===== Media Queries ===== */
@media (max-width: 768px) {
    .soporte-header {
        padding: 1.25rem 1rem;
    }

    .header-content {
        gap: 1rem;
    }

    .header-info h1 {
        font-size: 1.4rem;
    }

    .soporte-container {
        padding: 1.5rem 0.75rem;
    }

    .panel-content {
        padding: 2rem 1.5rem;
        min-height: auto;
        border-radius: 12px;
        max-height: 90vh;
    }

    .welcome-section h2 {
        font-size: 1.75rem;
    }

    .icon-welcome {
        font-size: 3.5rem;
    }

    .info-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .stat {
        padding: 1.25rem 1rem;
    }

    .chat-bubble {
        max-width: 85%;
        padding: 0.85rem 1.1rem;
        font-size: 0.9rem;
    }

    .chat-box {
        max-height: 60vh;
        padding: 1.25rem;
        gap: 0.75rem;
    }

    .chat-input-bar {
        padding: 1rem 1.25rem;
        gap: 0.6rem;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .btn-large {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }

    .toast-container {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }

    .toast {
        max-width: 100%;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .soporte-container {
        padding: 1rem 0;
    }

    .panel-content {
        border-radius: 0;
        padding: 1.5rem;
        max-height: 95vh;
    }

    .header-info h1 {
        font-size: 1.2rem;
    }

    .header-subtitle {
        font-size: 0.8rem;
    }

    .welcome-section h2 {
        font-size: 1.4rem;
    }

    .welcome-section > p {
        font-size: 0.95rem;
    }

    .status-badge {
        font-size: 0.9rem;
    }

    .chat-bubble {
        max-width: 90%;
    }

    .chat-box {
        max-height: 65vh;
    }

    .ticket-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
