/* ===================================================
   COMPONENTS.CSS - Estilos específicos de componentes
   =================================================== */

/* ===== MENU STYLES ===== */
.header {
    background: rgba(0, 0, 0, 0.85);
    padding: 10px 25px;
    border-bottom: 2px solid #d4af37;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-image {
    height: 50px;
    width: auto;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 28px;
    color: #d4af37;
    margin: 0;
    line-height: 1;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.logo-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #cccccc;
    margin-top: -5px;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.nav-user {
    color: #d4af37;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.profile-icon {
    font-size: 18px;
}

.nav-link:not(.nav-admin)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #d4af37;
    transition: width 0.3s ease;
}

.nav-link:not(.nav-admin):hover::after {
    width: 100%;
}

.nav-link:hover {
    color: #d4af37;
}

.nav-admin {
    background-color: rgba(74, 74, 112, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid #6c6c9a;
}

.nav-admin:hover {
    background-color: #5a5a8a;
    color: #fff;
}

/* ===== REDES SOCIALES ===== */
.social-bar {
    position: fixed;
    top: 80px;
    left: 20px;
    transform: none;
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 10px;
    z-index: 999;
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.social-link img {
    width: 30px;
    height: 30px;
}

.social-link:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--glow-color, #fff);
}

.facebook {
    --glow-color: #1877F2;
    border-color: #1877F2;
}

.instagram {
    --glow-color: #E4405F;
    border-color: #E4405F;
}

.whatsapp {
    --glow-color: #25D366;
    border-color: #25D366;
}

/* Estilos alternativos para widgets */
.social-widgets {
    position: fixed;
    right: 20px;
    top: 180px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: top 0.3s ease;
}

.social-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.discord-widget {
    background: linear-gradient(135deg, #7289da, #5b6eae);
}

.whatsapp-widget {
    background: linear-gradient(135deg, #25d366, #1ebe57);
}

.social-widget:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.widget-text {
    position: absolute;
    right: 70px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.social-widget:hover .widget-text {
    opacity: 1;
    transform: translateX(0);
}

/* ===== INFORMACION SERVER ===== */
.server-info {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid #d4af37;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.server-info h4 {
    margin: 0 0 10px 0;
    color: #d4af37;
    font-size: 16px;
    text-align: center;
    text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}

.server-info p {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-info strong {
    color: #d4af37;
}

.status-online {
    color: #4CAF50;
    font-weight: bold;
}

.status-offline {
    color: #f44336;
    font-weight: bold;
}

/* ===== PAGINATION STYLES ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    gap: 5px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #333;
    background-color: #fff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.pagination .disabled {
    color: #6c757d;
    background-color: #fff;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* === ESTILOS DEL CHAT FLOTANTE === */
.chat-container {
    position: fixed;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

/* Botón flotante - Diseño elegante */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 120px;
    height: 50px;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 204, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    user-select: none;
    color: #1a1a1a;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 204, 0, 0.6);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

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

.chat-toggle i {
    font-size: 18px;
    color: #1a1a1a;
}

.chat-text {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    padding: 0 4px;
}

.chat-banned-message {
    width: 100%;
    text-align: center;
    padding: 10px;
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    font-weight: 600;
    font-size: 13px;
}

.chat-error-bar {
    display: none;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    font-weight: 600;
}

/* Ventana del chat */
.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: rgba(31, 41, 55, 0.95);
    border-radius: 15px;
    border: 2px solid #ffcc00;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.chat-window.show {
    display: flex;
    animation: chatSlideIn 0.3s ease-out;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del chat */
.chat-header {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
}

.chat-title i {
    font-size: 16px;
}

.online-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

.chat-close {
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Área de mensajes */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: rgba(17, 24, 39, 0.8);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

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

.chat-loading {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
    font-size: 14px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.chat-message.own {
    align-items: flex-end;
}

.chat-message.own .message-bubble {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #1a1a1a;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #9ca3af;
}

.message-info.own {
    justify-content: flex-end;
}

.message-username {
    font-weight: 600;
    color: #ffcc00;
}

.message-time {
    opacity: 0.7;
}

.message-bubble {
    background: rgba(55, 65, 81, 0.8);
    color: #f3f4f6;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Input del chat */
.chat-input-container {
    padding: 15px;
    background: rgba(17, 24, 39, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative;
}

.emoji-toggle {
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.4);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.emoji-toggle:hover {
    background: rgba(255, 204, 0, 0.2);
    border-color: #ffcc00;
    transform: scale(1.05);
}

.emoji-toggle.active {
    background: rgba(255, 204, 0, 0.3);
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

.emoji-icon {
    font-size: 18px;
    line-height: 1;
}

.chat-input {
    flex: 1;
    background: rgba(55, 65, 81, 0.8);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 20px;
    padding: 10px 15px;
    color: #f3f4f6;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-send {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border: none;
    border-radius: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1a1a1a;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 11px;
    padding: 0 12px;
    min-width: 70px;
}

.chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

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

.chat-send i {
    font-size: 12px;
}

.send-text {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Panel de emoticones */
.emoji-panel {
    position: absolute;
    bottom: 70px;
    left: 15px;
    right: 15px;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

.emoji-panel.show {
    display: block;
    animation: emojiSlideUp 0.3s ease-out;
}

@keyframes emojiSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.emoji-grid::-webkit-scrollbar {
    width: 4px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: #ffcc00;
    border-radius: 2px;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    background: rgba(55, 65, 81, 0.5);
}

.emoji-item:hover {
    background: rgba(255, 204, 0, 0.2);
    transform: scale(1.1);
}

/* Responsivo */
@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: 400px;
        right: 20px;
        left: 20px;
    }
    
    .chat-toggle {
        bottom: 15px;
        right: 15px;
        min-width: 100px;
        height: 45px;
        padding: 0 15px;
    }
    
    .chat-toggle i {
        font-size: 16px;
    }
    
    .chat-text {
        font-size: 12px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-item {
        font-size: 16px;
        padding: 6px;
    }
    
    .chat-send {
        min-width: 60px;
        font-size: 10px;
        padding: 0 8px;
    }
    
    .send-text {
        display: none;
    }
}

/* --- NUEVOS ESTILOS PARA MENSAJES DEL SISTEMA --- */
.chat-message.system-warning .message-bubble {
    background: rgba(255, 140, 0, 0.2);
    border: 1px solid #ff8c00;
}

.chat-message.system-warning .message-username.system {
    color: #ff8c00;
    font-weight: bold;
}

/* Animación para nuevos mensajes */
@keyframes newMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.new {
    animation: newMessage 0.3s ease-out;
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: #1f2937;
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid var(--accent);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.form-title {
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-alert {
    display: none;
    margin-top: 1rem;
}

/* ===== OAUTH BUTTONS ===== */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.facebook-btn {
    background: #1877F2;
    color: white;
}

.facebook-btn:hover {
    background: #166fe5;
    transform: translateY(-2px);
}

.google-btn {
    background: white;
    color: #333;
    border: 2px solid #ddd;
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    transform: translateY(-2px);
}

.oauth-separator {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.oauth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.oauth-separator span {
    background: rgba(55, 65, 81, 0.9);
    padding: 0 1rem;
    color: var(--foreground);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header {
        padding: 10px 15px;
    }
    
    .nav-menu {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .social-widgets {
        right: 10px;
        top: 120px;
    }
    
    .social-widget {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .server-info {
        right: 10px;
        top: 10px;
        padding: 10px 15px;
        font-size: 12px;
        min-width: 180px;
    }
    
    .chat-container {
        margin: 0 10px;
        padding: 15px;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .modal-content {
        margin: 0 10px;
        padding: 1.5rem;
    }
}

/* ===== CHAT FLOTANTE ===== */
.chat-container {
    position: fixed;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 120px;
    height: 50px;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 204, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    user-select: none;
    color: #1a1a1a;
    padding: 0 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 204, 0, 0.6);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

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

.chat-toggle i {
    font-size: 18px;
    color: #1a1a1a;
}

.chat-text {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    padding: 0 4px;
}

.chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: rgba(31, 41, 55, 0.95);
    border-radius: 15px;
    border: 2px solid #ffcc00;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.chat-window.show {
    display: flex;
    animation: chatSlideIn 0.3s ease-out;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-banned-message {
    width: 100%;
    text-align: center;
    padding: 10px;
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    font-weight: 600;
    font-size: 13px;
}

.chat-error-bar {
    display: none;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .social-widgets {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin: 20px 0;
    }
    
    .server-info {
        position: static;
        margin: 10px;
        text-align: center;
    }
    
    .chat-form {
        flex-direction: column;
    }
    
    .chat-submit {
        align-self: stretch;
    }
    
    .chat-toggle {
        bottom: 10px;
        right: 10px;
        min-width: 100px;
        height: 45px;
        font-size: 12px;
    }
    
    .chat-window {
        bottom: 70px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 320px;
    }
}