/* Forum Styles */

/* Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    max-width: 400px;
    width: calc(100% - 40px);
    border-radius: 24px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.large-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.modal-body {
    padding: 1rem 2rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.modal-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.modal-footer-text a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.modal-footer-text a:hover {
    text-decoration: underline;
}

/* Forum Container */
.forum-container {
    padding-top: 100px;
    min-height: 100vh;
}

/* Guest View */
.guest-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 2rem;
}

.forum-hero {
    text-align: center;
    max-width: 600px;
}

.forum-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.forum-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

.forum-preview {
    margin-top: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.preview-stats {
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    gap: 3rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.stat-item i {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* Forum Interface */
.forum-interface {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 100px);
    gap: 1rem;
    padding: 0 1rem 1rem;
}

/* Sidebar */
.forum-sidebar {
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-avatar {
    position: relative;
    width: 50px;
    height: 50px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
}

.user-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.user-status.online {
    background: #00ff88;
}

.user-status.away {
    background: #ffa500;
}

.user-status.offline {
    background: #666666;
}

.user-info {
    flex: 1;
}

.user-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.user-role.admin {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.logout-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Online Users */
.online-users h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-count {
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid var(--glass-border);
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-item:hover {
    background: var(--glass-bg);
}

.user-item .user-avatar {
    width: 32px;
    height: 32px;
}

.user-item .user-info h5 {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-item .user-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Admin Panel */
.admin-panel h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #ff6b6b;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* Chat Area */
.chat-area {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.chat-header {
    padding: 1.5rem;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.chat-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1rem 1.5rem;
    overflow-y: auto;
    background: var(--glass-bg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    gap: 1rem;
    animation: messageSlideIn 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--glass-border);
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.875rem;
}

.message-author.admin {
    color: #ff6b6b;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-text {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.own .message-text {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.message.system .message-text {
    background: #ffa500;
    color: var(--bg-primary);
    font-style: italic;
    text-align: center;
}

/* Chat Input */
.chat-input-area {
    padding: 1.5rem;
    border-radius: 0 0 20px 20px;
    border-top: 1px solid var(--glass-border);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.typing-dots {
    display: flex;
    gap: 2px;
}

.typing-dots span {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.input-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.input-container input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-container input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.input-container input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

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

/* User Management Table */
.users-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.table-body {
    max-height: 400px;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s ease;
}

.table-row:hover {
    background: var(--glass-bg);
}

.table-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.action-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.action-btn.danger:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    z-index: 10001;
    min-width: 150px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    color: var(--text-primary);
}

.menu-item:hover {
    background: var(--glass-bg);
}

.menu-item i {
    width: 16px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .forum-interface {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .forum-sidebar {
        display: none;
    }
    
    .auth-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .preview-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .table-actions {
        justify-content: flex-start;
    }
}