/* ============================================
   KOMUNIKAČNÍ PLATFORMA - STYLOVÁNÍ
   Modern Dark Theme s Glassmorphism efekty
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-hover: #5a6fd6;
    --secondary-color: #764ba2;

    /* Dark Theme */
    --bg-dark: #0f0f1a;
    --bg-card: rgba(25, 25, 40, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glass: rgba(255, 255, 255, 0.15);

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.3);

    /* Spacing */
    --header-height: 64px;
    --sidebar-width: 320px;

    /* Animation */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    /* Changed from min-height to fixed height */
    overflow: hidden;
    /* Prevent body scroll */
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.sphere-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-color);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.sphere-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    display: inline-flex;
    margin-bottom: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    padding-left: 48px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
}

input:not([type="submit"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-glass-hover);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

input:not([type="submit"]):focus+.input-icon,
input:not([type="submit"]):focus~.input-icon {
    color: var(--primary-color);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Non-icon inputs */
.form-group>input:not(.input-wrapper input),
.form-group>select,
.form-group>textarea {
    padding-left: 16px;
}

select {
    padding-left: 16px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Fix for option visibility in dropdowns */
select option {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 8px;
}

textarea {
    padding-left: 16px;
    resize: vertical;
    min-height: 80px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-icon {
    padding: 10px;
    border-radius: 10px;
}

.btn-small {
    padding: 6px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border-color: var(--error);
}

.btn-login {
    padding: 16px;
    font-size: 16px;
    margin-top: 8px;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

.flash-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

/* ============================================
   HEADER
   ============================================ */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.logo-text svg {
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    position: relative;
}

.user-avatar.clickable {
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-avatar.clickable::after {
    content: '📷';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: 10px;
}

.user-avatar.clickable:hover::after {
    opacity: 1;
}

.user-avatar.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.user-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-avatar {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    color: var(--error);
}

.role-editor {
    color: var(--warning);
}

.role-scenarista {
    color: #a855f7;
}

.role-daber {
    color: var(--info);
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-page {
    padding-top: var(--header-height);
}

.dashboard-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
    position: relative;
    /* Ensure z-index works */
}

/* ============================================
   ACTIVITY SIDEBAR (LEFT)
   ============================================ */

.activity-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
}

.activity-sidebar.closed {
    width: 0;
    opacity: 0;
    overflow: hidden;
    border: none;
    margin: 0;
}

.activity-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.activity-group {
    margin-bottom: 24px;
}

.activity-role-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.activity-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.activity-user:hover {
    background: var(--bg-glass);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Online/Offline Badge */
.user-avatar-small::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-avatar-small.online::after {
    background: var(--success);
}

.user-avatar-small.offline::after {
    background: var(--text-muted);
    opacity: 0.5;
}

.activity-username {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   ACTIVITY SIDEBAR (LEFT)
   ============================================ */

.activity-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.activity-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.activity-group {
    margin-bottom: 24px;
}

.activity-role-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.activity-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.activity-user:hover {
    background: var(--bg-glass);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Online/Offline Badge */
.user-avatar-small::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-avatar-small.online::after {
    background: var(--success);
}

.user-avatar-small.offline::after {
    background: var(--text-muted);
    opacity: 0.5;
}

.activity-username {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   ACTIVITY SIDEBAR (LEFT)
   ============================================ */

.activity-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 10;
}

.activity-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.activity-group {
    margin-bottom: 24px;
}

.activity-role-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.activity-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.activity-user:hover {
    background: var(--bg-glass);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    position: relative;
    flex-shrink: 0;
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* Online/Offline Badge */
.user-avatar-small::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-avatar-small.online::after {
    background: var(--success);
}

.user-avatar-small.offline::after {
    background: var(--text-muted);
    opacity: 0.5;
}

.activity-username {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   CHAT AREA
   ============================================ */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow: hidden;
    min-width: 0;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
    padding: 40px;
    text-align: center;
}

.empty-state svg {
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 24px;
    color: var(--text-secondary);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    /* Force full height */
}

.chat-container.hidden {
    display: none;
}

.chat-header {
    padding: 20px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.chat-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.chat-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-badge {
    padding: 4px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 70%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.message-own {
    align-self: flex-end;
    background: var(--primary-color);
    border: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Specific text color for own messages to ensure contrast */
.message-own .message-content,
.message-own .message-author,
.message-own .message-time,
.message-own .message-delete-btn {
    color: #ffffff;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.message-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.message-own .message-delete-btn {
    color: rgba(255, 255, 255, 0.7);
}

.message:hover .message-delete-btn {
    opacity: 1;
}

.message-delete-btn:hover {
    color: var(--error);
}

.message-own .message-delete-btn:hover {
    color: #ffcccc;
}

.message-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-avatar-default {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar-default svg {
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.message-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-own .message-time {
    color: rgba(255, 255, 255, 0.7);
}

.message-content {
    word-break: break-word;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 400;
}

.message-form {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.message-form input {
    flex: 1;
    padding-left: 16px;
}

.message-form .btn {
    padding: 14px 20px;
}

.main-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 10;
}

.main-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.dashboard-layout {
    display: flex;
    flex: 1;
    /* Take remaining height */
    overflow: hidden;
    position: relative;
    height: auto;
    min-height: 0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-close {
    display: none;
}

.sidebar-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.project-item:hover {
    background: var(--bg-glass);
}

.project-item.active {
    background: var(--bg-glass);
    border-color: var(--primary-color);
}

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon svg {
    color: white;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-creator {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-projects {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Project Groups with Rooms */
.project-group {
    margin-bottom: 4px;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.project-header:hover {
    background: var(--bg-glass);
}

.project-group.expanded .project-header {
    background: var(--bg-glass);
    border-color: var(--border-color);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.chevron {
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.project-group.expanded .chevron {
    transform: rotate(180deg);
}

.project-rooms {
    display: none;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 8px;
    margin-bottom: 8px;
}

.project-rooms.expanded {
    display: block;
}

.room-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
}

.room-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.room-item.active {
    background: var(--primary-gradient);
}

.room-item.has-unread {
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: 9px;
}

.room-item.has-unread::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    margin-left: auto;
    box-shadow: 0 0 5px var(--warning);
    animation: unreadPulse 2s infinite;
}

@keyframes unreadPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.room-icon {
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.room-name {
    flex: 1;
    font-size: 14px;
}

.room-type-label {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.room-type-label.free {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.room-type-label.editor {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Room type badge in chat header */
.room-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.room-type-badge.free {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.room-type-badge.editor {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* No write permission info */
.no-write-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
    font-size: 14px;
}

.no-write-info.hidden {
    display: none;
}

/* File messages */
.file-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 4px;
}

.file-download {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-download a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.file-download a:hover {
    text-decoration: underline;
}

/* Fix for own messages file links */
.message-own .file-download a {
    color: #ffffff !important;
    text-decoration: underline;
}

.message-own .file-download svg {
    color: #ffffff !important;
}

/* Remove background and padding for file messages in own messages to remove extra gap */
.message-own .file-message {
    background: transparent;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
    gap: 2px;
}

/* Specific styling for messages with files to remove bottom gap */
.message.message-has-file {
    padding-bottom: 4px;
    /* Reduced from 8px */
}

/* Media previews */
.media-preview {
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

.media-preview img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.media-preview img:hover {
    transform: scale(1.02);
}

.media-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    background: #000;
}

.media-preview.audio-preview {
    width: 100%;
    max-width: none;
    min-width: 300px;
}

.media-preview audio {
    width: 100%;
    min-width: 300px;
    height: 54px;
    border-radius: 27px;
}

/* Style for audio in webkit browsers */
.media-preview audio::-webkit-media-controls-panel {
    background: var(--bg-glass);
}

/* Form help text */
.form-help {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    padding: 10px;
    background: var(--bg-glass);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* ============================================
   ADMIN PAGE
   ============================================ */

.admin-page {
    padding-top: var(--header-height);
}

.admin-content {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.admin-card-large {
    grid-column: span 1;
}

.card-header {
    padding: 20px 24px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.badge {
    padding: 6px 14px;
    background: var(--primary-gradient);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Users Table */
.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.users-table tbody tr {
    transition: background var(--transition-fast);
}

.users-table tbody tr:hover {
    background: var(--bg-glass);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.role-admin {
    background: rgba(239, 68, 68, 0.2);
}

.role-badge.role-editor {
    background: rgba(245, 158, 11, 0.2);
}

.role-badge.role-daber {
    background: rgba(59, 130, 246, 0.2);
}

.role-badge.role-moderator {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.role-badge.role-scenarista {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.inline-form {
    display: inline;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-glass);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-card-large {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 54px;
        right: 0;
        bottom: 0;
        transform: translateX(100%);
        z-index: 200;
        background: #191928 !important;
        backdrop-filter: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .user-details {
        display: none;
    }

    .logo-text span {
        display: none;
    }

    .message {
        max-width: 85%;
    }

    .admin-content {
        padding: 16px;
    }

    .flash-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-glass);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: 12px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary-gradient);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   CHECKBOXES
   ============================================ */

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-label:hover {
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    font-size: 14px;
}

/* ============================================
   ROLE TAGS
   ============================================ */

.role-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-tag.role-admin {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.role-tag.role-editor {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.role-tag.role-scenarista {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.role-tag.role-daber {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.room-roles-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.room-type-label {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-glass);
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============================================
   ADDITIONAL ROLE BADGE STYLES
   ============================================ */

.role-badge.role-scenarista {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

/* ============================================
   EMPTY ROOMS
   ============================================ */

.empty-rooms {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   ROLE SELECT IN TABLE
   ============================================ */

.role-select {
    padding: 6px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.role-select:hover {
    border-color: var(--primary-color);
}

/* ============================================
   ROLE INFO IN ADMIN
   ============================================ */

.role-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: 10px;
}

.role-item p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================
   ADMIN CARD FULL WIDTH
   ============================================ */

.admin-card-full {
    grid-column: 1 / -1;
}

/* ============================================
   TEXT MUTED
   ============================================ */

.text-muted {
    color: var(--text-muted);
}

/* Project Icon Image */
.project-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar Toggle Desktop */
@media (min-width: 769px) {
    .sidebar {
        width: var(--sidebar-width);
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
        border-left: 1px solid var(--border-color);
        background: var(--bg-card);
        flex-shrink: 0;
    }

    .sidebar.closed {
        width: 0;
        opacity: 0;
        overflow: hidden;
        border: none;
        margin: 0;
    }

    .chat-area {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
    }

    .sidebar-toggle-desktop {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle-desktop {
        display: none;
    }
}

/* THEMES */
/* Blue (Default-ish) */
body.theme-blue {
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #60a5fa;
}

/* Purple (Original) */
body.theme-purple {
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary-color: #a78bfa;
}

/* Green (Success) */
body.theme-green {
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #34d399;
}

/* Orange (Warning) */
body.theme-orange {
    --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --primary-color: #f59e0b;
    --primary-hover: #d97706;
    --secondary-color: #fbbf24;
}

/* Pink (Hot) */
body.theme-pink {
    --primary-gradient: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    --primary-color: #ec4899;
    --primary-hover: #db2777;
    --secondary-color: #f472b6;
}

/* Dark/Monochrome */
body.theme-dark {
    --primary-gradient: linear-gradient(135deg, #4b5563 0%, #1f2937 100%);
    --primary-color: #6b7280;
    --primary-hover: #4b5563;
    --secondary-color: #9ca3af;
    --bg-dark: #000000;
    --bg-card: rgba(20, 20, 20, 0.9);
}

/* ============================================
   MODAL TABS & LISTS
   ============================================ */

.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-select-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-glass);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-select-item {
    padding: 8px;
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-select-item:hover {
    background: var(--bg-glass-hover);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .activity-sidebar {
        display: none;
        /* Hide activity panel on smaller screens for now */
    }
}

/* ============================================
   MODAL TABS & LISTS
   ============================================ */

.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-select-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    background: var(--bg-glass);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-select-item {
    padding: 8px;
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-select-item:hover {
    background: var(--bg-glass-hover);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .activity-sidebar {
        display: none;
        /* Hide activity panel on smaller screens for now */
    }
}

/* ============================================
   PHONE RESPONSIVE (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {

    /* --- HEADER --- */
    .main-header {
        padding: 0 12px;
        height: 54px;
    }

    .header-right {
        gap: 4px;
    }

    .header-right .btn-icon {
        padding: 8px;
    }

    .user-info {
        padding: 4px 8px;
        gap: 8px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .user-details {
        display: none;
    }

    .logo-text span {
        display: none;
    }

    .logo-text img {
        width: 28px !important;
        height: 28px !important;
    }

    /* Show hamburger menu on mobile */
    .menu-toggle {
        display: flex !important;
    }

    /* Show activity toggle on mobile too */
    .sidebar-toggle-desktop {
        display: flex !important;
        margin-right: 4px !important;
        padding: 8px !important;
    }

    /* --- DASHBOARD LAYOUT --- */
    .dashboard-page {
        padding-top: 54px;
    }

    .dashboard-layout {
        height: calc(100vh - 54px);
        height: calc(100dvh - 54px);
    }

    /* --- ACTIVITY SIDEBAR (LEFT) --- */
    .activity-sidebar {
        display: flex !important;
        position: fixed;
        top: 54px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border-color);
        background: #191928 !important;
    }

    .activity-sidebar.closed {
        transform: translateX(-100%);
        width: 280px;
        opacity: 1;
        border: none;
    }

    .activity-sidebar:not(.closed) {
        transform: translateX(0);
    }

    /* --- ROOMS SIDEBAR (RIGHT) --- */
    .sidebar {
        position: fixed;
        top: 54px;
        right: 0;
        bottom: 0;
        width: 300px;
        z-index: 200;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        background: #191928 !important;
        backdrop-filter: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.closed {
        transform: translateX(100%);
        width: 300px;
    }

    .sidebar-close {
        display: flex;
    }

    /* --- CHAT AREA --- */
    .chat-area {
        width: 100%;
        min-width: 0;
        height: calc(100vh - 54px);
        height: calc(100dvh - 54px);
        overflow: hidden;
    }

    .chat-container {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    .messages-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 10px;
        gap: 6px;
    }

    .message-form {
        flex-shrink: 0;
        background: #191928;
        border-top: 1px solid var(--border-color);
        z-index: 10;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .chat-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .chat-header h2 {
        font-size: 15px;
    }

    .chat-members {
        display: none;
    }

    /* Messages */
    .messages-container {
        padding: 10px;
        gap: 6px;
    }

    .message {
        max-width: 88%;
        padding: 6px 10px;
        font-size: 14px;
    }

    .message-header {
        gap: 6px;
    }

    .message-author {
        font-size: 12px;
    }

    .message-time {
        font-size: 10px;
    }

    /* Link previews on mobile */
    .link-preview-embed {
        max-width: 100%;
    }

    .link-preview-image {
        max-height: 150px;
    }

    /* --- MESSAGE FORM --- */
    .message-form {
        padding: 8px 10px;
        gap: 6px;
    }

    .message-form input[type="text"] {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding: 10px 14px;
    }

    .message-form .btn {
        padding: 10px;
        flex-shrink: 0;
    }

    /* Mention dropdown */
    .mention-dropdown {
        bottom: 100%;
        max-height: 180px;
        width: calc(100% - 20px);
        left: 10px;
    }

    /* Typing indicator */
    .typing-indicator {
        padding: 2px 10px;
        font-size: 11px;
    }

    /* --- MODALS --- */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        margin: 10px auto;
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    /* --- EMPTY STATE --- */
    .empty-state {
        padding: 24px;
    }

    .empty-state h2 {
        font-size: 18px;
    }

    .empty-state svg {
        width: 60px;
        height: 60px;
    }

    /* --- OVERLAY BACKDROP --- */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 54px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 150;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* File messages on mobile */
    .media-preview img,
    .media-preview video {
        max-width: 100%;
    }

    .media-preview audio {
        width: 100%;
    }
}