@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #000c1a;
    --bg-card: rgba(0, 20, 51, 0.7);
    --border-color: rgba(0, 136, 255, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --mobile-logout-offset: 48px;
    
    --primary: #0054a6;
    --primary-gradient: linear-gradient(135deg, #0054a6 0%, #003377 100%);
    --accent-blue: #0088ff;
    --accent-gradient: linear-gradient(135deg, #0088ff 0%, #0054a6 100%);
    
    --success: #10b981;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.2);
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-glow: 0 0 20px rgba(0, 84, 166, 0.35);
    --shadow-danger: 0 0 20px rgba(239, 68, 68, 0.35);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 84, 166, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 136, 255, 0.15) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(0, 84, 166, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Containers */
.glass-container {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Auth Pages (Login & Register) */
body.auth-page {
    background: #002855 url('../images/auth-bg.jpg') center center / cover no-repeat fixed;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 20, 60, 0.72) 0%,
        rgba(0, 52, 120, 0.55) 50%,
        rgba(0, 15, 45, 0.78) 100%
    );
    z-index: 0;
    pointer-events: none;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px 32px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

body.auth-page .auth-card.glass-container {
    background: rgba(0, 28, 68, 0.88);
    border: 1px solid rgba(120, 180, 255, 0.18);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.auth-page .form-control {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(100, 160, 230, 0.22);
}

body.auth-page .form-control:focus {
    border-color: #0088ff;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.15);
}

body.auth-page .form-label {
    color: rgba(200, 220, 245, 0.9);
}

body.auth-page .auth-subtitle {
    color: rgba(180, 205, 235, 0.85);
}

body.auth-page .btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004999 100%);
    box-shadow: 0 4px 16px rgba(0, 84, 166, 0.4);
}

body.auth-page .btn-primary:hover {
    box-shadow: 0 6px 22px rgba(0, 102, 204, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.is-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.isbank-logo {
    max-width: 260px;
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(1.15) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.is-logo-text {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.is-title-side {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.is-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
}

.is-slogan {
    font-size: 0.85rem;
    color: var(--accent-blue);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 6px;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-glow);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    opacity: 0.95;
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.auth-footer a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    animation: shake 0.4s ease;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fc8181;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

/* Chat Main Layout */
.app-container {
    max-width: 1200px;
    height: 90vh;
    margin: 5vh auto;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.channel-header-bar {
    flex-wrap: wrap;
    gap: 12px;
}

.channel-avatar {
    background: var(--accent-gradient) !important;
    font-weight: 700;
    font-size: 1.1rem;
}

.online-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.online-list-empty {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.online-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.online-user-chip .online-dot {
    position: static;
    width: 9px;
    height: 9px;
    border: none;
}

.online-user-name {
    font-weight: 500;
}

.user-info-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-status-label {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    color: #94a3b8;
    background: rgba(100, 116, 139, 0.15);
    flex-shrink: 0;
}

.user-status-label.is-online {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
}

.user-status-label.is-offline {
    color: #94a3b8;
    background: rgba(100, 116, 139, 0.15);
}

.personel-edit-panel {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 136, 255, 0.06);
    animation: fadeIn 0.3s ease;
}

.personel-edit-panel .panel-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-blue);
}

.selectable-user {
    cursor: pointer;
}

.user-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-role-badge.admin {
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.2);
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--danger);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

.btn-bulk-delete {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.btn-bulk-delete:hover {
    background: var(--danger);
    color: #fff;
}

.bulk-delete-panel {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(239, 68, 68, 0.06);
}

.bulk-delete-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fca5a5;
    margin-bottom: 12px;
}

.bulk-delete-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.bulk-delete-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.bulk-date-input {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    height: 36px !important;
    min-width: 160px;
}

.bulk-delete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bulk-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 8px;
    cursor: pointer;
}

.online-users-bar {
    display: none;
}

.mobile-logout-btn {
    display: none;
}

.typing-indicator {
    display: none;
    padding: 0 4px 10px;
    font-size: 0.84rem;
    color: var(--accent-blue);
    font-style: italic;
    min-height: 0;
    border-bottom: 1px dashed rgba(0, 136, 255, 0.15);
    margin-bottom: 10px;
}

.typing-indicator:not(:empty) {
    display: block;
}

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

.online-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #64748b;
    border: 2px solid var(--bg-card);
    transition: var(--transition-smooth);
}

.online-dot.is-online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: rgba(6, 182, 212, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 16px;
    min-height: 0;
}

.chat-loading {
    align-self: center;
    margin: auto 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.message-group {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: messageIn 0.3s ease-out forwards;
}

.message-group.mine {
    align-self: flex-end;
}

.message-group.other {
    align-self: flex-start;
}

.message-sender {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding-left: 6px;
}

.mine .message-sender {
    text-align: right;
    padding-right: 6px;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.mine .message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.other .message-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 6px;
}

.other .message-meta {
    color: var(--text-secondary);
}

/* Chat Media Renderers */
.media-attachment {
    margin-top: 8px;
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
}

.image-attachment {
    max-width: 320px;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.image-attachment:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Custom Audio Player */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 14px;
    border-radius: 12px;
    min-width: 250px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 6px;
}

.audio-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: black;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.audio-play-btn:hover {
    transform: scale(1.08);
}

.audio-progress-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.audio-progress-bar {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
    width: 0%;
}

.audio-time {
    font-size: 0.75rem;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.8);
}

/* Chat Input Controls */
.chat-input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    box-sizing: border-box;
    flex-shrink: 0;
}

#chat-form {
    width: 100%;
}

.upload-previews {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.preview-details {
    display: flex;
    flex-direction: column;
}

.preview-name {
    font-size: 0.8rem;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.btn-remove-preview {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: var(--danger);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: var(--transition-smooth);
}

.btn-remove-preview:hover {
    background: var(--danger);
    color: white;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 16px;
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#input-controls {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.input-container:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    background: rgba(255, 255, 255, 0.05);
}

.chat-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    padding: 8px 4px;
    resize: none;
    height: 40px;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-icon.active {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.btn-send {
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

/* Voice Recorder Widget overlay */
.recorder-overlay {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.recorder-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--danger);
    font-weight: 500;
}

.record-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulseGlow 1s infinite alternate;
}

.recorder-timer {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.audio-visualizer-canvas {
    flex: 1;
    height: 32px;
    border-radius: 6px;
    background: rgba(0,0,0,0.15);
}

/* Admin Dashboard layout */
.admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    height: 85vh;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-title {
    padding: 20px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
}

.user-list-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-list-item.active {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-info-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.user-info-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.admin-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 16px;
}

.no-chat-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulseGlow {
    from { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    to { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Responsive Rules */
@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .admin-sidebar {
        height: 300px;
    }
    
    .admin-main {
        height: 500px;
    }
}

@media (max-width: 600px) {
    .app-container {
        height: 100vh;
        height: 100dvh;
        margin: 0;
        padding: 0;
    }
    
    .glass-container {
        border-radius: 0;
        border: none;
    }
    
    .message-group {
        max-width: 90%;
    }

    /* Personel mobil: flex düzen, yazı alanı altta görünür */
    body[data-user-role="user"] {
        height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
    }

    body[data-user-role="user"] .app-container {
        height: 100dvh;
        margin: 0;
        padding: 0;
        padding-top: var(--mobile-logout-offset, 48px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    body[data-user-role="user"] .app-header,
    body[data-user-role="user"] .online-users-list {
        display: none;
    }

    body[data-user-role="user"] .chat-wrapper.glass-container {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    body[data-user-role="user"] .chat-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 8px 12px 12px;
        justify-content: flex-end;
        position: static;
    }

    body[data-user-role="user"] .chat-input-area {
        flex-shrink: 0;
        position: relative;
        z-index: 120;
        width: 100%;
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        background: rgba(0, 12, 26, 0.98);
        border-top: 1px solid var(--border-color);
        box-sizing: border-box;
    }

    body[data-user-role="user"] #chat-form,
    body[data-user-role="user"] .input-container {
        width: 100%;
        max-width: 100%;
    }

    body[data-user-role="user"] .input-container {
        gap: 4px;
        padding: 4px 6px;
    }

    body[data-user-role="user"] #input-controls {
        gap: 4px;
    }

    body[data-user-role="user"] .input-actions {
        gap: 2px;
    }

    body[data-user-role="user"] .chat-input {
        font-size: 16px;
        height: 34px;
        padding: 6px 2px;
    }

    body[data-user-role="user"] .btn-icon {
        width: 30px;
        height: 30px;
    }

    body[data-user-role="user"] .btn-send {
        width: 34px;
        height: 34px;
    }

    body[data-user-role="user"] .alert {
        position: fixed;
        top: 8px;
        left: 10px;
        right: 10px;
        z-index: 130;
        margin: 0;
    }

    body[data-user-role="user"] .mobile-logout-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: fixed;
        top: max(8px, env(safe-area-inset-top));
        right: 10px;
        z-index: 140;
        padding: 7px 11px;
        border-radius: 999px;
        background: rgba(0, 12, 26, 0.92);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        text-decoration: none;
        font-size: 0.76rem;
    }

    /* Mobile Header Layout optimization (admin vb.) */
    .app-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-user-info {
        width: 100%;
    }

    .header-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    .header-actions form {
        flex: 1;
        margin-right: 4px;
        display: flex;
        width: 100%;
    }

    .header-actions form .form-control {
        width: 100% !important;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .header-actions form button {
        height: 36px !important;
        font-size: 0.75rem !important;
    }

    .chat-messages {
        padding: 16px;
    }

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

    .input-container {
        padding: 6px 8px;
        border-radius: 12px;
        gap: 6px;
    }

    .chat-input {
        font-size: 16px;
        height: 36px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .btn-send {
        width: 36px;
        height: 36px;
    }
}
