/* ====================================================================
   PromptGet - Community Chat & Moderation System Stylesheet
   Design System: Dark Aurora Glow, Glassmorphism, Responsive UI
   ==================================================================== */

:root {
    --bg-main: #050508;
    --bg-surface: #0c0d14;
    --bg-surface-elevated: #131520;
    --bg-glass: rgba(18, 20, 32, 0.75);
    --bg-glass-card: rgba(255, 255, 255, 0.03);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.3);
    
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #06b6d4 100%);
    --admin-gradient: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.18);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Layout Structure --- */
.page-community {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.community-container {
    max-width: 1200px;
    margin: 90px auto 40px auto;
    width: 95%;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Navigation Header Adjustments --- */
.nav-landing {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 0;
}

.nav-item.active {
    color: #fff;
    font-weight: 600;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* --- Chat Wrapper & Card --- */
.chat-main-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 80vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), var(--shadow-glow);
    overflow: hidden;
    position: relative;
}

/* --- Top Header Bar --- */
.chat-header {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-header-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.chat-header-title h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-title p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Pinned Banner --- */
.pinned-announcements-bar {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.12) 0%, rgba(6, 182, 212, 0.12) 100%);
    border-bottom: 1px solid rgba(139, 92, 246, 0.25);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.pinned-announcements-bar.hidden {
    display: none;
}

.pinned-content-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pinned-icon-tag {
    color: #fbbf24;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.pinned-text {
    color: #f1f5f9;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-author {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* --- Messages Stream Container --- */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.messages-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* --- Message Card Item --- */
.chat-message-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 85%;
    animation: fadeInMsg 0.3s ease-out forwards;
    position: relative;
}

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

.chat-message-item.is-pinned {
    background: rgba(251, 191, 36, 0.04);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
}

.chat-message-item.own-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.user-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.user-avatar.admin-avatar {
    border-color: #ff4b2b;
    box-shadow: 0 0 10px rgba(255, 75, 43, 0.4);
}

.message-bubble-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-meta-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

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

.user-display-name {
    font-weight: 600;
    color: #e2e8f0;
}

.role-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.badge-admin {
    background: var(--admin-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 65, 108, 0.3);
}

.role-badge.badge-member {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-violet);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.msg-timestamp {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.message-body {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
    color: #f1f5f9;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.own-message .message-body {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(6, 182, 212, 0.25) 100%);
    border-color: rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md);
}

.msg-image-attachment {
    margin-top: 8px;
    max-width: 320px;
    max-height: 320px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.msg-image-attachment:hover {
    transform: scale(1.02);
}

/* --- Admin Moderation Context Actions --- */
.msg-actions-trigger {
    opacity: 0;
    transition: opacity var(--transition-fast);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-message-item:hover .msg-actions-trigger {
    opacity: 1;
}

.msg-actions-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* --- Input Control Bar --- */
.chat-input-area {
    padding: 16px 20px;
    background: rgba(12, 13, 20, 0.9);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-form-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-text-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.chat-text-input:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-chat-action {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.btn-chat-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Admin Image Upload Special Button */
.btn-admin-camera {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.4);
    color: var(--accent-pink);
}

.btn-admin-camera:hover {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

.btn-chat-send {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    padding: 0 22px;
    height: 44px;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Guest / Banned Notification Banner */
.guest-login-banner, .banned-notice-banner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.banned-notice-banner {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.user-warning-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: #fbbf24;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* --- Modals & Overlays --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    padding: 28px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    position: relative;
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #fff;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: #fff;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-violet);
}

.btn-primary-block {
    width: 100%;
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.btn-google-login {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1f2937;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.btn-google-login:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent-violet);
}

/* Lightbox Image Preview Modal */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.92);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* Responsive adjustments across all devices (<1024px, <768px, <480px) */
@media (max-width: 1024px) {
    .community-container {
        width: 95%;
        margin-top: 85px;
    }
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 12, 20, 0.96);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-subtle);
        padding: 18px 24px;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
        z-index: 1001;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-item {
        padding: 8px 12px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-item:hover, .nav-item.active {
        background: rgba(139, 92, 246, 0.15);
    }

    .community-container {
        margin-top: 75px;
        width: 100%;
        padding: 0;
        gap: 0;
    }

    .chat-main-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        height: calc(100vh - 75px);
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-header-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .chat-header-title h2 {
        font-size: 1.05rem;
    }

    .chat-header-title p {
        font-size: 0.76rem;
    }

    .chat-message-item {
        max-width: 95%;
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    .input-form-row {
        gap: 8px;
    }

    .chat-text-input {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .btn-chat-send {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .chat-header-title h2 {
        font-size: 0.95rem;
    }

    .chat-header-title p {
        display: none;
    }

    .btn-chat-send span {
        display: none;
    }

    .btn-chat-send {
        padding: 10px 14px;
        border-radius: 50%;
        width: 42px;
        height: 42px;
        justify-content: center;
    }

    .modal-card {
        padding: 22px 18px;
        width: 92%;
    }

    .btn-google-login {
        padding: 11px 14px;
        font-size: 0.88rem;
    }
}
