    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: 'Arial', sans-serif;
        background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #0f0f0f);
        color: #ffffff;
        line-height: 1.6;
        overflow-x: hidden;
        min-height: 100vh;
    }

    /* Header */
    .header {
        background: linear-gradient(135deg, #000000, #1a0000);
        border-bottom: 3px solid #DC143C;
        padding: 15px 20px;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        gap: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
        transition: transform 0.3s ease;
    }

    .header.hidden {
        transform: translateY(-100%);
    }

    .menu-toggle {
        font-size: 24px;
        color: #ffffff;
        cursor: pointer;
        transition: color 0.3s ease;
    }

    .menu-toggle:hover {
        color: #DC143C;
    }

    .logo-img {
        height: 80px;
        width: auto;
    }

    .username {
        color: #FFB6C1;
        font-weight: bold;
        margin-left: auto;
    }

    /* Desktop Auth Buttons */
    .desktop-auth {
        display: flex;
        gap: 15px;
        margin-left: auto;
    }

    .auth-btn {
        padding: 10px 20px;
        border: 2px solid #DC143C;
        border-radius: 8px;
        text-decoration: none;
        font-weight: bold;
        font-size: 14px;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .login-btn {
        background: transparent;
        color: #DC143C;
    }

    .login-btn:hover {
        background: #DC143C;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
    }

    .register-btn {
        background: #DC143C;
        color: white;
    }

    .register-btn:hover {
        background: #ff1450;
        border-color: #ff1450;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
    }

    .logout-btn {
        background: #555;
        color: white;
        border-color: #666;
    }

    .logout-btn:hover {
        background: #666;
        border-color: #777;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
    }

    .desktop-user-menu {
        display: flex;
        gap: 15px;
        margin-left: auto;
    }

    /* Mobile styles - hide auth buttons */
    @media (max-width: 768px) {
        .desktop-auth {
            display: none !important;
        }

        .desktop-user-menu {
            display: none !important;
        }

        .username {
            display: none;
        }

        .mobile-auth-section {
            display: block;
        }
    }

    /* Desktop styles - hide mobile auth section */
    @media (min-width: 769px) {
        .mobile-auth-section {
            display: none;
        }
    }

    /* Desktop styles - hide username */
    @media (min-width: 769px) {
        .username {
            display: none;
        }
    }

    @media (min-width: 769px) {
        body {
            overflow: hidden;
            /* Elimina el scroll de la página */
        }

        .chat-main {
            overflow-y: auto;
            /* Permitir scroll en el contenedor del chat */
            height: 100vh;
            /* Asegura que el contenedor del chat ocupe toda la altura */
        }
    }

    /* Slide Menu */
    .slide-menu {
        position: fixed;
        left: -300px;
        top: 0;
        width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, #000000, #1a0000);
        z-index: 1001;
        transition: left 0.3s ease;
        padding-top: 80px;
        border-right: 2px solid #DC143C;
    }

    .slide-menu.open {
        left: 0;
    }

    .menu-overlay {
        display: none;
    }

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

    .menu-item {
        display: block;
        padding: 15px 30px;
        color: #ffffff;
        text-decoration: none;
        border-bottom: 1px solid rgba(220, 20, 60, 0.3);
        transition: all 0.3s ease;
    }

    .menu-item:hover {
        background: rgba(220, 20, 60, 0.2);
        padding-left: 40px;
    }

    .menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 1002;
    }

    .menu-close i {
        font-size: 24px;
        color: #ffffff;
        cursor: pointer;
        transition: color 0.3s ease;
    }

    .menu-close i:hover {
        color: #DC143C;
    }

    .menu-item i {
        margin-right: 10px;
        color: #DC143C;
    }

    /* Mobile Auth Section */
    .mobile-auth-section {
        border-top: 1px solid rgba(220, 20, 60, 0.3);
        margin-top: 20px;
        padding-top: 20px;
    }

    .mobile-auth-btn {
        background: rgba(139, 0, 0, 0.2);
        margin-bottom: 10px;
        border: 1px solid rgba(220, 20, 60, 0.3);
        border-radius: 6px;
    }

    .mobile-auth-btn:hover {
        background: rgba(220, 20, 60, 0.3);
    }

    .mobile-auth-btn#mobileLogoutBtn {
        background: rgba(102, 102, 102, 0.2);
        border-color: rgba(102, 102, 102, 0.3);
    }

    .mobile-auth-btn#mobileLogoutBtn:hover {
        background: rgba(102, 102, 102, 0.3);
    }

    /* Main Content */
    .main-content {
        margin-top: 120px;
        padding: 0;
        height: calc(100vh - 120px);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Chat Container */
    .chat-container {
        width: 100%;
        max-width: 100%;
        height: calc(100vh - 120px);
        background: linear-gradient(135deg, #1a0000, #0a0a0a, #1a0000);
        border: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: none;
        position: relative;
    }

    @media (max-width: 768px) {
        .main-content {
            padding: 10px;
        }

        .chat-container {
            max-width: none;
            border: 2px solid #DC143C;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        }
    }

    .chat-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent, rgba(220, 20, 60, 0.1), transparent);
        border-radius: 15px;
        pointer-events: none;
        animation: chatGlow 3s ease-in-out infinite;
    }

    @keyframes chatGlow {

        0%,
        100% {
            opacity: 0.3;
        }

        50% {
            opacity: 0.7;
        }
    }

    /* Chat Header */
    .chat-header {
        background: linear-gradient(135deg, #2a0000, #DC143C, #2a0000);
        padding: 20px;
        border-bottom: 2px solid #8B0000;
        position: relative;
        z-index: 2;
    }

    .chat-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: white;
        flex-wrap: wrap;
        gap: 15px;
    }

    .chat-title h1 {
        margin: 0;
        font-size: 24px;
        font-weight: bold;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .chat-title i {
        color: #FFB6C1;
        animation: iconPulse 2s ease-in-out infinite;
    }

    .online-status {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(0, 0, 0, 0.3);
        padding: 8px 15px;
        border-radius: 20px;
        font-size: 14px;
        color: #90EE90;
    }

    .status-dot {
        width: 10px;
        height: 10px;
        background: #00ff00;
        border-radius: 50%;
        animation: statusPulse 2s ease-in-out infinite;
    }

    @keyframes statusPulse {

        0%,
        100% {
            opacity: 1;
            transform: scale(1);
        }

        50% {
            opacity: 0.6;
            transform: scale(1.2);
        }
    }

    /* Chat Messages */
    .chat-messages {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        background: rgba(0, 0, 0, 0.5);
        position: relative;
    }

    .chat-messages::-webkit-scrollbar {
        width: 8px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: rgba(139, 0, 0, 0.2);
        border-radius: 4px;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: #DC143C;
        border-radius: 4px;
    }

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: #ff1450;
    }

    /* Welcome Message */
    .welcome-message {
        text-align: center;
        padding: 40px 20px;
        color: #FFB6C1;
        background: rgba(139, 0, 0, 0.1);
        border: 1px solid rgba(220, 20, 60, 0.3);
        border-radius: 15px;
        margin-bottom: 20px;
    }

    .welcome-message i {
        font-size: 48px;
        color: #DC143C;
        margin-bottom: 15px;
        animation: ghostFloat 3s ease-in-out infinite;
    }

    @keyframes ghostFloat {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-10px);
        }
    }

    .welcome-message h3 {
        color: #DC143C;
        font-size: 28px;
        margin: 15px 0;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }

    /* Message Item */
    .message-item {
        display: flex;
        margin-bottom: 15px;
        align-items: flex-start;
        gap: 12px;
        animation: messageSlideIn 0.3s ease-out;
    }

    @keyframes messageSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .message-item.own {
        flex-direction: row-reverse;
    }

    .message-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #DC143C, #8B0000);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 18px;
        flex-shrink: 0;
        border: 2px solid rgba(220, 20, 60, 0.5);
    }

    .message-item.own .message-avatar {
        background: linear-gradient(135deg, #8B0000, #DC143C);
    }

    .message-content {
        max-width: 70%;
        background: rgba(20, 20, 20, 0.9);
        border: 1px solid rgba(220, 20, 60, 0.3);
        border-radius: 15px;
        padding: 12px 16px;
        position: relative;
    }

    .message-item.own .message-content {
        background: rgba(139, 0, 0, 0.2);
        border-color: rgba(139, 0, 0, 0.5);
    }

    .message-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 5px;
    }

    .message-author {
        font-weight: bold;
        color: #FFB6C1;
        font-size: 14px;
    }

    .message-time {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.6);
    }

    .message-text {
        color: white;
        line-height: 1.4;
        word-wrap: break-word;
        font-size: 15px;
    }

    .message-image {
        max-width: 300px;
        max-height: 200px;
        border-radius: 8px;
        margin-top: 8px;
        cursor: pointer;
        transition: transform 0.3s ease;
        border: 1px solid rgba(220, 20, 60, 0.3);
    }

    .message-image:hover {
        transform: scale(1.05);
    }

    /* Reply and Delete Functionality */
    .reply-indicator {
        background: rgba(220, 20, 60, 0.1);
        border-left: 3px solid #DC143C;
        padding: 8px 12px;
        margin-bottom: 8px;
        border-radius: 0 8px 8px 0;
        font-size: 13px;
        color: #FFB6C1;
    }

    .reply-indicator i {
        margin-right: 5px;
        color: #DC143C;
    }

    .message-options {
        display: flex;
        gap: 5px;
        margin-top: 8px;
    }

    .option-btn {
        background: rgba(139, 0, 0, 0.3);
        border: 1px solid rgba(220, 20, 60, 0.3);
        color: #FFB6C1;
        padding: 4px 8px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
        transition: all 0.3s ease;
    }

    .option-btn:hover {
        background: rgba(220, 20, 60, 0.3);
        color: white;
    }

    .delete-btn:hover {
        background: rgba(255, 0, 0, 0.3);
        border-color: rgba(255, 0, 0, 0.5);
    }

    .reply-preview {
        background: rgba(220, 20, 60, 0.1);
        border: 1px solid rgba(220, 20, 60, 0.3);
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 10px;
        display: none;
    }

    .reply-preview.active {
        display: block;
    }

    .reply-preview-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }

    .reply-preview-text {
        font-size: 13px;
        color: #FFB6C1;
    }

    .cancel-reply {
        background: none;
        border: none;
        color: #DC143C;
        cursor: pointer;
        font-size: 14px;
    }

    .cancel-reply:hover {
        color: #ff1450;
    }

    /* Typing Indicator */
    .typing-indicator {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px 20px;
        background: rgba(0, 0, 0, 0.3);
        border-top: 1px solid rgba(220, 20, 60, 0.3);
        animation: typingSlideIn 0.3s ease-out;
    }

    @keyframes typingSlideIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .typing-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(135deg, #DC143C, #8B0000);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 14px;
    }

    .typing-content {
        color: #FFB6C1;
        font-size: 14px;
    }

    .typing-user {
        font-weight: bold;
        color: #DC143C;
    }

    .typing-dots {
        display: inline-flex;
        gap: 3px;
        margin-left: 8px;
    }

    .typing-dots span {
        width: 6px;
        height: 6px;
        background: #DC143C;
        border-radius: 50%;
        animation: typingDots 1.5s ease-in-out infinite;
    }

    .typing-dots span:nth-child(1) {
        animation-delay: 0s;
    }

    .typing-dots span:nth-child(2) {
        animation-delay: 0.3s;
    }

    .typing-dots span:nth-child(3) {
        animation-delay: 0.6s;
    }

    @keyframes typingDots {

        0%,
        60%,
        100% {
            opacity: 0.3;
            transform: scale(0.8);
        }

        30% {
            opacity: 1;
            transform: scale(1.2);
        }
    }

    /* Chat Input */
    .chat-input-container {
        background: linear-gradient(135deg, #2a0000, #1a0000);
        border-top: 2px solid #8B0000;
        padding: 15px 20px;
        position: relative;
    }

    .input-wrapper {
        display: flex;
        align-items: flex-end;
        gap: 10px;
        background: rgba(0, 0, 0, 0.5);
        border: 2px solid rgba(220, 20, 60, 0.3);
        border-radius: 25px;
        padding: 8px 15px;
        transition: all 0.3s ease;
    }

    .input-wrapper:focus-within {
        border-color: #DC143C;
        box-shadow: 0 0 15px rgba(220, 20, 60, 0.3);
    }



    .chat-input {
        flex: 1;
        background: transparent;
        border: none;
        color: white;
        font-size: 16px;
        resize: none;
        outline: none;
        min-height: 20px;
        max-height: 100px;
        font-family: Arial, sans-serif;
        line-height: 1.4;
    }

    .chat-input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }

    .char-counter {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.5);
        align-self: flex-end;
        margin-bottom: 2px;
    }

    .send-btn {
        background: linear-gradient(135deg, #DC143C, #8B0000);
        border: none;
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    .send-btn:hover {
        background: linear-gradient(135deg, #ff1450, #DC143C);
        transform: scale(1.1);
        box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4);
    }

    .send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }



    /* Responsive Design */
    @media (max-width: 768px) {
        .main-content {
            padding: 10px;
            height: calc(100vh - 70px);
        }

        .chat-container {
            height: calc(100vh - 90px);
            border-radius: 10px;
            max-width: none;
        }

        .chat-header {
            padding: 15px;
        }

        .chat-title {
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .chat-title h1 {
            font-size: 20px;
        }

        .chat-messages {
            padding: 15px;
        }

        .welcome-message {
            padding: 30px 15px;
        }

        .welcome-message i {
            font-size: 36px;
        }

        .welcome-message h3 {
            font-size: 22px;
        }

        .message-content {
            max-width: 85%;
        }

        .chat-input-container {
            padding: 12px 15px;
        }


    }

    @media (max-width: 480px) {
        .main-content {
            padding: 5px;
            height: calc(100vh - 60px);
        }

        .chat-container {
            height: calc(100vh - 70px);
            border-radius: 8px;
        }

        .chat-header {
            padding: 12px;
        }

        .chat-title h1 {
            font-size: 18px;
        }

        .online-status {
            font-size: 12px;
            padding: 6px 12px;
        }

        .chat-messages {
            padding: 12px;
        }

        .welcome-message {
            padding: 25px 12px;
        }

        .welcome-message h3 {
            font-size: 20px;
        }

        .message-content {
            max-width: 90%;
            padding: 10px 12px;
        }

        .message-avatar {
            width: 35px;
            height: 35px;
            font-size: 16px;
        }

        .chat-input {
            font-size: 14px;
        }

        .send-btn {
            width: 35px;
            height: 35px;
            font-size: 14px;
        }


    }

    /* Modal de confirmación */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }

    .modal-overlay.active {
        display: flex;
    }

    .modal-content {
        background: linear-gradient(135deg, #1a0000, #2a0000);
        border: 2px solid #DC143C;
        border-radius: 15px;
        padding: 30px;
        max-width: 400px;
        width: 90%;
        text-align: center;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
        animation: modalSlideIn 0.3s ease-out;
    }

    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translateY(-50px) scale(0.8);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .modal-icon {
        font-size: 48px;
        color: #DC143C;
        margin-bottom: 20px;
    }

    .modal-title {
        color: #ffffff;
        font-size: 24px;
        margin-bottom: 15px;
        font-weight: bold;
    }

    .modal-message {
        color: #FFB6C1;
        font-size: 16px;
        margin-bottom: 30px;
        line-height: 1.5;
    }

    .modal-buttons {
        display: flex;
        gap: 15px;
        justify-content: center;
    }

    .modal-btn {
        padding: 12px 25px;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 100px;
    }

    .modal-btn-confirm {
        background: linear-gradient(135deg, #DC143C, #8B0000);
        color: white;
        border: 2px solid #DC143C;
    }

    .modal-btn-confirm:hover {
        background: linear-gradient(135deg, #ff1450, #DC143C);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4);
    }

    .modal-btn-cancel {
        background: rgba(102, 102, 102, 0.2);
        color: white;
        border: 2px solid #666;
    }

    .modal-btn-cancel:hover {
        background: rgba(102, 102, 102, 0.4);
        border-color: #888;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 102, 102, 0.3);
    }

    @media (max-width: 480px) {
        .modal-content {
            padding: 25px 20px;
            margin: 20px;
        }

        .modal-title {
            font-size: 20px;
        }

        .modal-message {
            font-size: 14px;
        }

        .modal-buttons {
            flex-direction: column;
        }

        .modal-btn {
            min-width: auto;
            width: 100%;
        }
    }