/* Base Styles & Reset */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #252525;
    --bg-editor: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-blue: #4361ee;
    --accent-purple: #7209b7;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --border-color: rgba(255, 255, 255, 0.05);
    
    /* Common Variables */
    --border-radius: 4px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ensure all text elements use Montserrat font */
body, button, input, select, textarea, .panel-btn, .sidebar-btn, .tab, .editor, .modal-content {
    font-family: var(--font-family);
}

/* Specifically target the panel buttons */
.panel-btn, .sidebar-btn {
    font-family: 'Montserrat', sans-serif;
}

/* Also ensure the mobile panel content uses the correct font */
.mobile-side-panel, .panel-content, .panel-content span {
    font-family: 'Montserrat', sans-serif;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 15px;
    z-index: 100;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Mobile Side Panel */
.mobile-side-panel {
    display: none;
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-secondary);
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    overflow: hidden; /* Prevent the panel itself from scrolling */
}

.mobile-side-panel.open {
    right: 0;
}

.panel-header {
    display: flex;
    justify-content: flex-end;
    padding: 5px;
    border-bottom: 1px solid var(--border-color);
}

#closePanelBtn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

#closePanelBtn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.panel-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto !important; /* Force overflow */
    -webkit-overflow-scrolling: touch; /* Better scrolling on iOS */
    max-height: calc(100vh - 60px); /* Set a max height */
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

.panel-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 14px;
    width: 100%;
    font-weight: 500;
}

.panel-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: var(--transition);
    z-index: 10;
    height: 100%;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.logo i {
    font-size: 22px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.toggle-sidebar-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    margin-left: auto;
    transition: var(--transition);
}

.toggle-sidebar-btn:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.sidebar-actions {
    flex: 1;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

.sidebar-actions::-webkit-scrollbar {
    width: 6px;
}

.sidebar-actions::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-actions::-webkit-scrollbar-thumb {
    background-color: var(--bg-tertiary);
    border-radius: 10px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.sidebar-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-btn:active {
    transform: scale(0.98);
}

.sidebar-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 0;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.theme-toggle button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.theme-toggle button i {
    transition: transform 0.5s ease;
}

.theme-toggle button:hover i {
    transform: rotate(30deg);
}

.font-size-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 15px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.font-size-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-size-buttons button {
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.font-size-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.font-size-buttons button:active {
    transform: scale(0.95);
}

#currentFontSize, #desktopCurrentFontSize {
    min-width: 40px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.help-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    width: 100%;
    text-align: left;
    font-weight: 500;
}

.help-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: var(--transition);
}

/* Tabs */
.tabs-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 10px;
    height: 60px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.tabs-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px 0;
    flex: 1;
}

.tabs::-webkit-scrollbar {
    display: none;
}

/* Drag and drop styles */
.tab.dragging {
    opacity: 0.5;
    cursor: move;
}

.tab.drag-over {
    border: 2px dashed var(--accent-blue);
}

/* Make tabs look draggable */
.tab {
    cursor: grab;
}

.tab:active {
    cursor: grabbing;
}

/* Ensure close button remains clickable */
.close-tab {
    cursor: pointer;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 30px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 14px;
    height: 36px;
    font-weight: 500;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.close-tab {
    background: transparent;
    border: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    transition: var(--transition);
}

.close-tab:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#addTabBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: var(--transition);
    margin-left: 8px;
    flex-shrink: 0;
}

#addTabBtn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Toolbar */
.toolbar-wrapper {
    position: relative;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}

.toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 4px;
    position: relative;
}

.toolbar-group:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 1px;
    background-color: var(--border-color);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius);
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.toolbar-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.toolbar-btn.active {
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--accent-blue);
}

.color-picker-container {
    position: relative;
    display: flex;
    align-items: center;
}

#textColorPicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    opacity: 0;
    cursor: pointer;
}

/* Editor */
#editorContainer {
    flex: 1;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-editor);
}

.editor {
    white-space: pre-wrap !important;
    word-wrap: break-word;
}

/* Ensure proper line height for better readability */
.editor br {
    line-height: inherit;
}

/* Ensure paragraphs have proper spacing */
.editor p {
    margin-bottom: 1em;
}

.editor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    font-size: 15pt;
    font-weight: 500; /* This makes the text bolder (semibold) */
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-editor);
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    display: none;
}

/* Add this to your CSS file */
.editor ul, .editor ol {
    margin-left: 0;
    padding-left: 25px; /* Proper indentation for list items */
}

.editor li {
    margin-bottom: 5px; /* Space between list items */
}

.editor::-webkit-scrollbar {
    width: 8px;
}

.editor::-webkit-scrollbar-track {
    background: transparent;
}

.editor::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.editor:focus {
    outline: none;
}

.editor:empty::before {
    content: "Start typing something amazing...";
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-metrics {
    display: flex;
    gap: 20px;
}

.word-count, .char-count, .line-count {
    white-space: nowrap;
}

.save-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.save-status.saving::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--warning);
    margin-right: 5px;
}

.save-status.saved::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    margin-right: 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

#closeModalBtn, #closeTransferModalBtn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeModalBtn:hover, #closeTransferModalBtn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 20px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.shortcut-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 5px;
}

kbd {
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    display: inline-block;
    font-size: 12px;
    font-family: monospace;
    line-height: 1;
    padding: 4px 6px;
}

.shortcut-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Transfer Tab Modal Styles */
#transferTabModal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#transferTabModal p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.action-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.code-display {
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

.code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 10px 0;
    position: relative;
}

#transferCode {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--text-primary);
}

#copyCodeBtn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copyCodeBtn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.code-expiry {
    text-align: center;
    font-size: 13px;
    color: var(--warning);
}

.code-input-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#codeInput {
    flex: 1;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: 2px;
    text-align: center;
}

#codeInput:focus {
    outline: none;
    border-color: var(--accent-blue);
}

#receiveTabBtn {
    min-width: 120px;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.warning {
    background: var(--warning);
}

.notification.error {
    background: var(--danger);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
    }
}

/* Tab Animation */
.tab {
    animation: fadeIn 0.3s ease-out;
}

.tab.active {
    animation: pulse 2s infinite;
}

/* Editor Animation */
.editor {
    animation: slideIn 0.3s ease-out;
}

/* Light Theme Specific Styles */
body.light-theme {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9e9e9;
    --bg-editor: #ffffff;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .editor::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .sidebar-btn:hover,
body.light-theme .toolbar-btn:hover,
body.light-theme #addTabBtn:hover,
body.light-theme .theme-toggle button:hover,
body.light-theme .help-link:hover,
body.light-theme #closeModalBtn:hover,
body.light-theme .panel-btn:hover,
body.light-theme #closePanelBtn:hover,
body.light-theme .mobile-menu-btn:hover,
body.light-theme #closeTransferModalBtn:hover,
body.light-theme #copyCodeBtn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.light-theme .editor:empty::before {
    color: rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar.expanded {
        width: var(--sidebar-width);
    }
    
    .sidebar:not(.expanded) .logo span,
    .sidebar:not(.expanded) .sidebar-btn span,
    .sidebar:not(.expanded) .theme-toggle span,
    .sidebar:not(.expanded) .font-size-control span,
    .sidebar:not(.expanded) .help-link span,
    .sidebar:not(.expanded) .font-size-buttons,
    .sidebar:not(.expanded) .theme-toggle button,
    .sidebar:not(.expanded) .divider {
        display: none;
    }
    
    .sidebar:not(.expanded) .sidebar-btn {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar:not(.expanded) .sidebar-btn i {
        margin: 0;
    }
    
    .sidebar:not(.expanded) .theme-toggle,
    .sidebar:not(.expanded) .font-size-control {
        justify-content: center;
        padding: 12px;
    }
    
    .toggle-sidebar-btn {
        display: block;
    }
    
    .sidebar:not(.expanded) .logo {
        justify-content: center;
        padding: 15px 0;
    }
    
    .sidebar:not(.expanded) .sidebar-footer {
        display: flex;
        justify-content: center;
        padding: 15px 0;
    }
    
    .sidebar:not(.expanded) .help-link {
        justify-content: center;
        padding: 8px;
    }
}

@media (max-width: 768px) {
    /* Hide desktop sidebar */
    .sidebar {
        display: none;
    }
    
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }
    
    /* Show mobile side panel */
    .mobile-side-panel {
        display: flex;
    }
    
    /* Adjust main content for mobile header */
    .main-content {
        /* padding-top: 60px; */
        height: calc(100vh - 60px);
        margin-top: 60px;
    }
    
    /* Make toolbar scroll horizontally */
    .toolbar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 10px;
    }
    
    .toolbar-group {
        flex-shrink: 0;
    }
    
    .toolbar-group:not(:last-child)::after {
        display: none;
    }
    
    /* Status bar adjustments */
    .status-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .status-bar::-webkit-scrollbar {
        display: none;
    }
    
    .status-metrics {
        flex-shrink: 0;
    }
    
    /* Transfer tab modal adjustments */
    .code-input-container {
        flex-direction: column;
    }
    
    #codeInput {
        width: 100%;
    }
    
    #receiveTabBtn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tabs-container {
        height: auto;
        padding: 5px;
    }
    
    .tab {
        padding: 6px 10px;
        height: 32px;
        font-size: 12px;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    
    .shortcuts-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
    
    #transferCode {
        font-size: 24px;
        letter-spacing: 3px;
    }
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .sidebar-btn span,
.sidebar.collapsed .theme-toggle span,
.sidebar.collapsed .font-size-control span,
.sidebar.collapsed .help-link span,
.sidebar.collapsed .font-size-buttons,
.sidebar.collapsed .theme-toggle button,
.sidebar.collapsed .divider {
    display: none;
}

.sidebar.collapsed .sidebar-btn {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .sidebar-btn i {
    margin: 0;
}

.sidebar.collapsed .theme-toggle,
.sidebar.collapsed .font-size-control {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .logo {
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .sidebar-footer {
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

.sidebar.collapsed .help-link {
    justify-content: center;
    padding: 8px;
}

/* Print Styles */
@media print {
    .sidebar, .tabs-container, .toolbar, .status-bar, .mobile-header, .mobile-side-panel {
        display: none !important;
    }
    
    .main-content {
        height: auto;
        overflow: visible;
        padding-top: 0;
        margin-top: 0;
    }
    
    #editorContainer {
        overflow: visible;
        height: auto;
    }
    
    .editor {
        position: static;
        height: auto;
        overflow: visible;
        color: black;
        background: white;
    }
}