/* style.css */

/* --- Custom Properties / Design Tokens --- */
:root {
    /* Color Palette */
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --accent: #06b6d4; /* Cyan */
    --accent-glow: rgba(6, 182, 212, 0.2);
    
    /* Dark Theme Tokens */
    --bg: #0b0f19;
    --bg-gradient: radial-gradient(circle at top left, #0f172a, #0b0f19);
    --panel-bg: rgba(22, 28, 45, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --code-header-bg: rgba(15, 23, 42, 0.8);
    
    /* Code Highlighting Tweaks */
    --code-bg: #0f1420;
    
    /* Shared settings */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    /* Light Theme Tokens */
    --bg: #f8fafc;
    --bg-gradient: radial-gradient(circle at top left, #eff6ff, #f8fafc);
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(0, 0, 0, 0.06);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(241, 245, 249, 0.8);
    --card-border: rgba(0, 0, 0, 0.04);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --code-header-bg: rgba(226, 232, 240, 0.9);
    --code-bg: #f1f5f9;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    transition: background var(--transition), color var(--transition);
}

/* --- Premium Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- Glassmorphism Helper --- */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

/* --- Layout Grid --- */
.app-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    width: 100vw;
}

/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--panel-border);
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand .logo {
    font-size: 24px;
    filter: drop-shadow(0 0 8px var(--primary));
    animation: bounce 2s infinite alternate;
}

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    position: relative;
}

.status-dot.online::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #10b981;
    border-radius: 50%;
    animation: ping 1.5s infinite ease-in-out;
}

.sidebar-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--panel-border);
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    width: 14px;
    height: 14px;
}

/* --- Explore Rooms Section --- */
.explore-rooms-widget {
    display: flex;
    flex-direction: column;
    max-height: 280px;
}

.room-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.room-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

#room-search-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 8px 12px 8px 30px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

#room-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.rooms-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 4px;
}

.room-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.room-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.room-item.active-room {
    background: var(--primary-glow);
    border-color: var(--primary);
}

.room-item-details {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex-grow: 1;
}

.room-item-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.room-item-badge.open {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.room-item-badge.private {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.room-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-delete-room {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-delete-room:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.btn-delete-room i, .btn-delete-room svg {
    width: 14px;
    height: 14px;
}

.rooms-loading, .rooms-error {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 4px;
}

.user-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.user-tag:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

/* User's profile badge in user list */
.user-tag.is-me {
    background: var(--primary-glow);
    border-color: var(--primary);
}

.profile-widget {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(99, 102, 241, 0.05);
    border-top: 1px solid var(--panel-border);
    border-bottom: none;
    padding: 16px 24px;
}

.profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
}

.profile-info {
    flex-grow: 1;
    overflow: hidden;
}

.profile-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.profile-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-box {
    border-bottom: none;
    background: rgba(6, 182, 212, 0.03);
    border-top: 1px solid var(--panel-border);
}

.info-box h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-box p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Workspace Area --- */
.workspace {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.workspace-header {
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    border-bottom: 1px solid var(--panel-border);
}

.workspace-title-area h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.workspace-title-area p {
    font-size: 12px;
    color: var(--text-muted);
}

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

/* --- Timelines & Post Cards --- */
.timeline-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.pastes-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* Message Paste Cards */
.paste-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.paste-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

/* Self Message Card distinction */
.paste-card.my-post {
    border-left: 4px solid var(--primary);
}

.paste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--code-header-bg);
    border-bottom: 1px solid var(--panel-border);
}

.paste-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paste-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.paste-author {
    font-weight: 600;
    font-size: 14px;
}

.paste-author.is-me::after {
    content: ' (You)';
    color: var(--primary);
    font-size: 11px;
    font-weight: 500;
}

.paste-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paste-time {
    font-size: 11px;
    color: var(--text-muted);
}

.paste-lang-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.paste-actions {
    display: flex;
    gap: 4px;
}

.paste-body {
    position: relative;
    padding: 0;
    background: var(--code-bg);
}

.paste-body pre {
    margin: 0;
    padding: 16px 20px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 13.5px;
    line-height: 1.6;
}

.paste-body code {
    background: none !important;
    padding: 0 !important;
    font-family: inherit;
}

/* Custom plaintext styling to differentiate from standard code */
.paste-body.plaintext-body pre {
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
}

/* Copy success tooltip or animation */
.btn-copy-code, .btn-share-paste, .btn-delete-paste, .btn-show-fullscreen, .btn-download-code {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-code:hover, .btn-share-paste:hover, .btn-show-fullscreen:hover, .btn-download-code:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-delete-paste:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.btn-copy-code i, .btn-share-paste i, .btn-delete-paste i, .btn-show-fullscreen i, .btn-download-code i,
.btn-copy-code svg, .btn-share-paste svg, .btn-delete-paste svg, .btn-show-fullscreen svg, .btn-download-code svg {
    width: 16px;
    height: 16px;
}

/* Scroll down floating button */
.scroll-bottom-btn {
    position: absolute;
    bottom: 24px;
    right: 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    transition: var(--transition);
    z-index: 100;
}

.scroll-bottom-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-hover);
}

.scroll-bottom-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

/* Empty timeline state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s infinite ease-in-out;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 320px;
}

/* --- Editor Input Pane --- */
.editor-pane {
    padding: 20px 32px;
    border-top: 1px solid var(--panel-border);
    z-index: 10;
}

.editor-pane form {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.editor-settings i {
    width: 16px;
    height: 16px;
}

.select-dropdown {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.select-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.editor-tips {
    font-size: 11px;
    color: var(--text-muted);
}

.editor-tips kbd {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 600;
}

.textarea-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    overflow: hidden;
    transition: var(--transition);
}

.textarea-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

#code-textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 13px;
    padding: 14px 16px;
    resize: none;
    line-height: 1.5;
}

/* Plain text placeholder style */
#code-textarea::placeholder {
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- Buttons System --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--input-border);
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.btn-icon i {
    width: 18px;
    height: 18px;
}

/* --- Username Modal System --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(8, 12, 21, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    padding: 36px;
    border-radius: var(--radius-lg);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-glow {
    font-size: 32px;
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 0 12px var(--primary));
    animation: pulse 2s infinite;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-group input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.error-text {
    font-size: 12px;
    color: #ef4444;
    min-height: 18px;
    display: block;
}

/* --- Animations --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

@keyframes ping {
    75%, 100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* --- Responsive Layout (Mobile Adapts) --- */
@media (max-width: 768px) {
    .app-grid {
        grid-template-columns: 1fr;
    }
    
    .workspace-header {
        padding: 16px 20px;
    }
    
    .timeline-container {
        padding: 16px 20px;
    }
    
    .editor-pane {
        padding: 16px 20px;
    }
    
    .editor-tips {
        display: none; /* Hide shortcut tips on mobile */
    }
}

/* --- Search Bar Styling --- */
.search-bar-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 320px;
    margin: 0 20px;
}

.search-bar-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar-wrapper input {
    width: 100%;
    padding: 7px 12px 7px 34px;
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.search-bar-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* --- Statistics Panels --- */
.stats-section {
    background: rgba(99, 102, 241, 0.02);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.stat-label {
    display: block;
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
    font-weight: 600;
}

/* --- Search Filter Utility --- */
.hidden-search {
    display: none !important;
}

/* Responsive Search Hide */
@media (max-width: 576px) {
    .search-bar-wrapper {
        display: none; /* Hide search bar on extra small screens to save space */
    }
}

/* --- Single Paste Modal Custom Styling --- */
.single-paste-content {
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.single-paste-body-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 15px;
    border-radius: var(--radius-md);
}

#single-paste-card-container .paste-card {
    border-radius: var(--radius-md);
    margin-bottom: 0;
    box-shadow: none;
    animation: none;
}

/* --- Typing Indicator Bar Styling --- */
.typing-indicator-bar {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--panel-border);
    animation: slideUp 0.2s ease-out;
}

.typing-indicator-bar.hidden {
    display: none !important;
}

/* Typing animated dot */
.typing-indicator-bar::after {
    content: '...';
    display: inline-block;
    width: 12px;
    animation: typingDots 1.5s infinite steps(4);
}

@keyframes typingDots {
    0%, 100% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* --- Drag & Drop Textarea Overlay --- */
.drag-drop-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 25, 0.9);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.2s ease;
}

.drag-drop-overlay.hidden {
    display: none !important;
}

.drag-drop-message {
    text-align: center;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drag-drop-message i {
    width: 48px;
    height: 48px;
    color: var(--primary);
    animation: bounce 1.5s infinite alternate;
}

.drag-drop-message span {
    font-size: 15px;
    font-weight: 600;
}

/* --- Expiry Badge Styling --- */
.paste-expiry-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.paste-expiry-badge i {
    width: 12px;
    height: 12px;
}

.paste-expiry-badge.warning-expiry {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    animation: pulse 1s infinite alternate;
}

/* --- Room Sytem UI Styles --- */
.room-widget {
    border-bottom: 1px solid var(--panel-border);
}

.room-info-card {
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.room-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.2);
    letter-spacing: 0.5px;
}

.room-badge.private {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.room-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
}

.room-actions {
    display: flex;
    gap: 8px;
}

.room-actions .btn {
    flex: 1;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* --- Mobile Layout & Sidebar Drawer Styles --- */
.mobile-only-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only-btn {
        display: inline-flex !important;
    }
    
    .mobile-hidden {
        display: none !important;
    }

    .sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1001;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--panel-border);
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 576px) {
    .workspace-header {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .workspace-title-area h2 {
        font-size: 16px;
    }
    
    .workspace-title-area p {
        font-size: 11px;
    }

    .paste-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 16px;
    }
    
    .paste-meta {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 24px 20px;
        max-width: 92%;
    }
    
    .logo-glow {
        font-size: 28px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
}

/* --- Collapsible Code Box Styles --- */
.paste-body.collapsed-code {
    max-height: 380px; /* limits viewport */
    overflow: hidden;
}

.paste-body.collapsed-code pre {
    max-height: 380px;
    overflow-y: hidden;
}

.paste-body.collapsed-code::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--code-bg) 80%);
    pointer-events: none;
}

.paste-expand-bar {
    padding: 10px 20px;
    background: var(--code-header-bg);
    border-top: 1px dashed var(--panel-border);
    display: flex;
    justify-content: center;
}

.btn-expand-code {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-expand-code:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-expand-code svg, .btn-expand-code i {
    width: 14px;
    height: 14px;
}

/* --- Code Block Line Numbers Styles --- */
.code-with-numbers {
    display: flex !important;
    gap: 0px !important;
    padding: 0 !important;
}

.line-numbers-col {
    display: flex;
    flex-direction: column;
    text-align: right;
    user-select: none;
    color: var(--text-muted);
    border-right: 1px solid var(--panel-border);
    padding: 16px 12px 16px 16px;
    background: rgba(0, 0, 0, 0.15);
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    min-width: 48px;
}

.line-numbers-col span {
    display: block;
}

.code-with-numbers code {
    flex-grow: 1;
    padding: 16px 20px !important;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 13px !important;
    line-height: 1.6;
    display: block;
}

/* --- Avatar Upload & Display Styles --- */
.avatar-upload-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.avatar-preview-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.join-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 4px 14px var(--primary-glow);
    border: 2px solid var(--panel-border);
    object-fit: cover;
    overflow: hidden;
}

.avatar-upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.avatar-upload-label:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.avatar-upload-label svg {
    width: 14px;
    height: 14px;
}

.hidden-file-input {
    display: none;
}

.user-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--panel-border);
    display: inline-block;
}

.user-avatar-fallback {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* For image elements inside paste card headers */
img.paste-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--panel-border);
}

.editor-input {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    width: 180px;
}

.editor-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* File badge styling inside paste cards */
.paste-title-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.paste-title-badge i, .paste-title-badge svg {
    width: 12px;
    height: 12px;
}

/* Flex wrap for editor-settings on small screens */
@media (max-width: 768px) {
    .editor-settings {
        flex-wrap: wrap;
    }
}






