/* Snippets Manager Styles */
.snippets-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background-color: #f8f9fa;
    overflow: hidden;
    margin-bottom: 20px;
}

#snippets-section:not(.active) .snippets-view {
    display: none;
}

.snippets-header {
    background: white;
    border-bottom: 1px solid #e1e4e8;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.snippets-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    line-height: 1.2;
}

/* Ensure header icon aligns nicely with text */
.snippets-header h1 i,
.snippets-header h1 svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

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

.snippets-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    background: white;
    color: #24292e;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.snippets-btn:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.snippets-btn-primary {
    background: #39c0a3;
    color: white;
    border-color: #29a489;
}

.snippets-btn-primary:hover {
    background: #5FD0C0;
    border-color: #34BA9E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 186, 158, 0.3);
}

.snippets-main-container {
    display: flex;
    height: calc(100% - 60px);
    min-height: 0;
}

.gutter {
    background-color: #e1e4e8;
    background-repeat: no-repeat;
    background-position: 50%;
    cursor: col-resize;
}

.gutter.gutter-horizontal {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+YMAzYwKjKKjIqMIqMio8ioyCgKVFJ/AwANDAEjKm8D3gAAAABJRU5ErkJggg==');
    cursor: col-resize;
    width: 10px;
}

.gutter.gutter-horizontal:hover {
    background-color: #d1d5da;
}

.snippets-left-panel {
    background: white;
    border-right: 1px solid #e1e4e8;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    /* Pre-size to Split.js default to avoid flicker before init */
    flex: 0 0 35%;
}

.snippets-search-container {
    padding: 16px;
    border-bottom: 1px solid #e1e4e8;
}

.snippets-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    background: #fafbfc;
}

.snippets-search-input:focus {
    outline: none;
    border-color: #0366d6;
    background: white;
}

.snippets-list {
    flex: 1;
    overflow-y: auto;
}

.snippet-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.snippet-item:hover {
    background: #f6f8fa;
}

.snippet-item.active {
    background: #e3f2fd;
    border-right: 3px solid #0366d6;
}

.snippet-title {
    font-weight: 500;
    font-size: 13px;
    color: #24292e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snippet-preview {
    font-size: 11px;
    color: #6a737d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Snippet Tags Styles */
.snippet-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Pin Button Styles */
.snippet-pin-container {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.snippet-pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}


.snippet-item {
    position: relative;
}

.snippet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 6px;
    min-height: 16px;
    align-items: center;
}

.snippet-tags .tag {
    font-size: 10x;
    padding: 1px 4px;
    max-width: 80px;
    border-radius: 10px;
}

.snippet-tags .add-tag-btn {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 10px;
    min-height: 12px;
}

.snippet-tags .tag-remove {
    width: 8px;
    height: 8px;
    font-size: 8px;
    margin-left: 2px;
}

/* Tag Filter for Snippets */
#snippetsTagFilter {
    padding: 8px 16px;
    border-bottom: 1px solid #e1e4e8;
    background: #ffffff;
}

#snippetsTagFilter .filter-tag {
    font-size: 10px;
    padding: 3px 8px;
}

/* Content Panel Tags */
#contentSnippetTags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 24px;
}

#contentSnippetTags .tag {
    font-size: 11px;
    padding: 3px 8px;
}

.snippets-right-panel {
    background: white;
    display: flex;
    flex-direction: column;
    /* Pre-size to Split.js default to avoid flicker before init */
    flex: 1 0 65%;
}

.snippets-editor-header {
    padding: 16px;
    border-bottom: 1px solid #e1e4e8;
    background: #ffffff;
}

.snippets-title-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    background: white;
    box-sizing: border-box;
}

.snippets-title-input:focus {
    outline: none;
    border-color: #0366d6;
}

.snippets-editor-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.snippets-quill-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    background: white;
    min-height: 300px;
    width: 100%;
}

.snippets-quill-editor .ql-toolbar {
    border: none;
    border-bottom: 1px solid #e1e4e8;
    border-radius: 6px 6px 0 0;
    background: #fafbfc;
    flex-shrink: 0;
}

.snippets-quill-editor .ql-container {
    border: none;
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 0 0 6px 6px;
    display: flex;
    flex-direction: column;
}

.snippets-quill-editor .ql-editor {
    padding: 16px;
    flex: 1;
    min-height: 200px;
    max-height: none;
    overflow-y: auto;
}

.snippets-quill-editor .ql-editor.ql-blank::before {
    color: #6a737d;
    font-style: normal;
    content: 'Enter your template content here... (Full rich text editing supported)\A\AYou can use:\A• Headers (H1-H6)\A• Bold, italic, underline, strikethrough\A• Colors and fonts\A• Lists and alignment\A• Links and images\A• Code blocks and quotes\A• For dynamic text, use the Variables button below to insert template variables.\A\A';
    white-space: pre-line;
}

.snippets-quill-editor:focus-within {
    border-color: #0366d6;
}

.snippets-editor-footer {
    padding: 16px;
    border-top: 1px solid #e1e4e8;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.snippets-save-status {
    font-size: 12px;
    color: #6a737d;
}

.snippets-save-status.saving {
    color: #f66a0a;
}

.snippets-save-status.saved {
    color: #28a745;
}

.snippets-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.snippets-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.snippets-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.snippets-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #24292e;
}

.snippets-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.snippets-close:hover {
    color: #000;
}

.snippets-modal-body {
    padding: 20px;
}

.snippets-import-instructions {
    margin-bottom: 16px;
    padding: 12px;
    background: #f6f8fa;
    border-radius: 6px;
    font-size: 14px;
    color: #586069;
    line-height: 1.5;
}

.snippets-paste-area {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
    box-sizing: border-box;
}

.snippets-paste-area:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.snippets-modal-footer {
    padding: 20px;
    border-top: 1px solid #e1e4e8;
    background: #fafbfc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.snippets-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #6a737d;
}

.snippets-empty-state-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.snippets-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #24292e;
}

.snippets-empty-state p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.hamburger-menu {
    position: relative;
}

.hamburger-icon {
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hamburger-icon:hover {
    opacity: 0.8;
}

.hamburger-bar {
    width: 20px;
    height: 2px;
    background-color: #24292e;
    margin: 2px 0;
}

.hamburger-menu-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.2s ease;
}

.hamburger-menu-dropdown.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.hamburger-menu-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
}

.hamburger-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #24292e;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f6f8fa;
    cursor: pointer;
}

.hamburger-menu-item i {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.chart-title i,
.snippets-btn i {
    margin-right: 6px;
    width: 14px;
    height: 14px;
}

.snippets-modal-header h3 i {
    margin-right: 8px;
}

.alert strong i {
    margin-right: 4px;
    width: 12px;
    height: 12px;
}

.hamburger-menu-item:last-child {
    border-bottom: none;
}

.hamburger-menu-item:hover {
    background: #f6f8fa;
}

.hamburger-menu-item.active {
    background: #e3f2fd;
    color: #0366d6;
}

.hamburger-menu-item.logout {
    color: #d73a49;
}

.hamburger-menu-item.logout:hover {
    background: #ffeaea;
}

.nav-buttons {
    display: none;
}

.hamburger-menu {
    display: block;
}

@media (max-width: 768px) {
    .hamburger-menu-dropdown {
        right: -10px;
        min-width: 180px;
    }
    
    .hamburger-menu-dropdown::before {
        right: 25px;
    }
}

@media (max-width: 480px) {
    .hamburger-menu-dropdown {
        right: -20px;
        min-width: 160px;
    }
    
    .hamburger-menu-dropdown::before {
        right: 35px;
    }
}

.hamburger-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.hamburger-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   VARIABLES MODAL STYLES
   =================================== */

/* Snippets Footer Actions */
.snippets-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Variables Modal Container */
.variables-modal,
.variable-values-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease-in-out;
}

.variables-modal.hidden,
.variable-values-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Variables Modal Content */
.variables-modal-content,
.variable-values-modal-content {
    background: white;
    border-radius: 8px;
    width: 700px;
    min-width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
    z-index: 1051;
}

.variable-values-modal-content {
    width: 500px;
    height: auto;
}

/* Modal Headers */
.variables-modal-header,
.variable-values-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.variables-modal-header h3,
.variable-values-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.variables-modal-close,
.variable-values-modal-close {
    background: none;
    border: none;
    color: #6a737d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variables-modal-close:hover,
.variable-values-modal-close:hover {
    background: #f6f8fa;
    color: #24292e;
}

/* Variables Modal Body */
.variables-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.variable-values-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* Add Variable Section */
.variables-add-section {
    padding: 16px 20px;
    border-bottom: 1px solid #e1e4e8;
    background: #f6f8fa;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.variables-form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.variables-input {
    flex: 1;
    min-width: 0;
    max-width: calc((100% - 56px) / 3);
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.variables-input:focus {
    outline: none;
    border-color: #34BA9E;
    box-shadow: 0 0 0 3px rgba(52, 186, 158, 0.1);
}

.variables-input::placeholder {
    color: #6a737d;
}

#add-variable-btn {
    background: #34BA9E;
    color: white;
    border: 1px solid #29a489;
    border-radius: 6px;
    padding: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

#add-variable-btn:hover {
    background: #2da68a;
    border-color: #2da68a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 186, 158, 0.3);
}

/* Variables List Container */
.variables-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.variables-list-header {
    padding: 16px 20px 12px 20px;
    border-bottom: 1px solid #e1e4e8;
    background: white;
    flex-shrink: 0;
}

.variables-list-header h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #24292e;
}

.variables-search-container {
    display: flex;
}

.variables-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    background: #fafbfc;
    transition: border-color 0.2s;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.variables-search-input:focus {
    outline: none;
    border-color: #34BA9E;
    background: white;
}

/* Variables List */
.variables-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background: white;
    min-height: 200px;
}

.variable-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.variable-item:hover {
    background: #f6f8fa;
}

.variable-item:last-child {
    border-bottom: none;
}

.variable-item.selected {
    background: #e3f2fd;
    border-left: 3px solid #34BA9E;
}

.variable-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variable-item-syntax {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #24292e;
    font-weight: 500;
    background: #f6f8fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e1e4e8;
}

.variable-item-description {
    font-size: 12px;
    color: #6a737d;
    line-height: 1.3;
}

.variable-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 2px;
}

.variable-item:hover .variable-item-actions {
    opacity: 1;
}

.variable-delete-btn {
    background: none;
    border: none;
    color: #6a737d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variable-delete-btn:hover {
    background: #ffeaea;
    color: #d73a49;
}

/* Variable Values Form */
.variable-value-group {
    margin-bottom: 16px;
}

.variable-value-group:last-child {
    margin-bottom: 0;
}

.variable-value-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #24292e;
    margin-bottom: 6px;
}

.variable-value-description {
    font-size: 12px;
    color: #6a737d;
    margin-bottom: 8px;
    font-style: italic;
}

.variable-value-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.variable-value-input:focus {
    outline: none;
    border-color: #34BA9E;
    box-shadow: 0 0 0 3px rgba(52, 186, 158, 0.1);
}

/* Empty States */
.variables-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #6a737d;
}

.variables-empty-state i {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 16px;
}

.variables-empty-state h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #24292e;
}

.variables-empty-state p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Modal Footers */
.variables-modal-footer,
.variable-values-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e1e4e8;
    background: #f6f8fa;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-height: 64px;
    position: relative;
    z-index: 1;
}

/* Buttons */
.variables-btn,
.variable-values-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    background: white;
    color: #24292e;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    height: 36px;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
}

.variables-btn:hover,
.variable-values-btn:hover {
    background: #f6f8fa;
    border-color: #d1d5da;
}

.variables-btn:disabled,
.variable-values-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.variables-btn-primary,
.variable-values-btn-primary {
    background: #34BA9E;
    color: white;
    border-color: #29a489;
}

.variables-btn-primary:hover:not(:disabled),
.variable-values-btn-primary:hover:not(:disabled) {
    background: #2da68a;
    border-color: #2da68a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 186, 158, 0.3);
}

.variables-btn-secondary,
.variable-values-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.variables-btn-secondary:hover,
.variable-values-btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile layout: remove viewport constraints for natural scrolling */
    .snippets-view {
        height: auto;
        overflow: visible;
    }
    
    .snippets-main-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .snippets-left-panel {
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
        max-height: 250px;
        min-height: 200px;
        width: 100%;
        flex: none;
        overflow-y: auto;
    }
    
    .snippets-right-panel {
        width: 100%;
        flex: none;
    }
    
    /* Hide Split.js gutters on mobile */
    .gutter {
        display: none;
    }
    
    .snippets-header {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .snippets-header h1 {
        margin: 0;
        text-align: left;
    }
    
    .snippets-header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
    }
    
    /* Hide Import and Export buttons on mobile */
    .snippets-header-actions button[onclick="openSnippetsImportModal()"],
    .snippets-header-actions button[onclick="exportSnippets()"] {
        display: none;
    }
    
    .snippets-btn {
        justify-content: center;
        white-space: nowrap;
    }
    
    .snippets-search-container {
        padding: 12px 16px;
        width: 100%;
    }
    
    .snippets-search-input,
    .snippets-title-input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .snippet-item {
        padding: 10px 16px;
    }
    
    .snippets-editor-header {
        padding: 12px 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .snippets-editor-content {
        padding: 12px 16px;
        overflow: visible;
    }
    
    .snippets-quill-editor {
        height: 400px;
        min-height: 400px;
    }
    
    .snippets-quill-editor .ql-container {
        flex: 1;
        min-height: 320px;
    }
    
    .snippets-quill-editor .ql-editor {
        min-height: 300px;
        max-height: none;
    }
    
    .snippets-editor-footer {
        padding: 12px 16px;
        flex-shrink: 0;
        background: #ffffff;
        border-top: 1px solid #e1e4e8;
    }
    
    .snippets-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .snippets-quill-editor .ql-editor {
        padding: 12px;
    }

    .hamburger-menu-dropdown {
        right: -10px;
        min-width: 180px;
    }
    
    .hamburger-menu-dropdown::before {
        right: 25px;
    }

    .variables-modal-content,
    .variable-values-modal-content {
        width: 95vw;
        min-width: 350px;
        margin: 20px;
    }
    
    .variables-form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .variables-input {
        width: 100%;
    }
    
    .variables-modal-header,
    .variable-values-modal-header {
        padding: 12px 16px;
    }
    
    .variables-modal-header h3,
    .variable-values-modal-header h3 {
        font-size: 16px;
    }
    
    .variables-add-section {
        padding: 12px 16px;
    }
    
    .variables-list-header {
        padding: 12px 16px;
    }
    
    .variable-item {
        padding: 10px 16px;
    }
    
    .variables-modal-footer,
    .variable-values-modal-footer {
        padding: 18px;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .snippets-header {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .snippets-header h1 {
        font-size: 16px;
    }
    
    .snippets-header-actions {
        gap: 6px;
    }
    
    .snippets-search-container {
        padding: 10px 12px;
    }
    
    .snippet-item {
        padding: 8px 12px;
    }
    
    .snippets-editor-header,
    .snippets-editor-content,
    .snippets-editor-footer {
        padding: 10px 12px;
    }
    
    .snippets-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .snippets-modal-content {
        width: 98%;
        margin: 5% auto;
        border-radius: 4px;
    }
    
    .snippets-quill-editor .ql-editor {
        padding: 10px;
    }

    .hamburger-menu-dropdown {
        right: -20px;
        min-width: 160px;
    }
    
    .hamburger-menu-dropdown::before {
        right: 35px;
    }

    .variables-modal-content,
    .variable-values-modal-content {
        width: 98vw;
        max-height: 85vh;
        border-radius: 4px;
        margin: 20px 1vw;
    }
    
    .variables-btn,
    .variable-values-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 70px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .variables-modal-content,
    .variable-values-modal-content {
        background: #1a1a1a;
        border: 1px solid #333;
    }
    
    .variables-modal-header,
    .variable-values-modal-header {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
    
    .variables-modal-header h3,
    .variable-values-modal-header h3 {
        color: #e6e6e6;
    }
    
    .variables-modal-close,
    .variable-values-modal-close {
        color: #999;
    }
    
    .variables-modal-close:hover,
    .variable-values-modal-close:hover {
        background: #333;
        color: #e6e6e6;
    }
    
    .variables-add-section {
        background: #2a2a2a;
        border-bottom-color: #333;
    }
    
    .variables-input,
    .variable-value-input,
    .variables-search-input {
        background: #1a1a1a;
        border-color: #333;
        color: #e6e6e6;
    }
    
    .variables-input:focus,
    .variable-value-input:focus,
    .variables-search-input:focus {
        border-color: #34BA9E;
    }
    
    .variables-list-header {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
    
    .variables-list-header h4 {
        color: #e6e6e6;
    }
    
    .variables-list {
        background: #1a1a1a;
    }
    
    .variable-item {
        border-bottom-color: #333;
    }
    
    .variable-item:hover {
        background: #2a2a2a;
    }
    
    .variable-item-syntax {
        background: #2a2a2a;
        border-color: #333;
        color: #e6e6e6;
    }
    
    .variable-item-description {
        color: #999;
    }
    
    .variable-value-label {
        color: #e6e6e6;
    }
    
    .variable-value-description {
        color: #999;
    }
    
    .variables-modal-footer,
    .variable-values-modal-footer {
        background: #2a2a2a;
        border-top-color: #333;
    }
    
    .variables-btn,
    .variable-values-btn {
        background: #333;
        border-color: #444;
        color: #e6e6e6;
    }
    
    .variables-btn:hover,
    .variable-values-btn:hover {
        background: #444;
    }
    
    .variables-btn-secondary,
    .variable-values-btn-secondary {
        background: #2a2a2a;
        color: #999;
    }
    
    .variables-btn-secondary:hover,
    .variable-values-btn-secondary:hover {
        background: #333;
        color: #e6e6e6;
    }
}

/* Private Toggle Styles */
.snippets-private-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.snippets-private-container .private-label {
    font-size: 13px;
    font-weight: 500;
    color: #656d76;
}

.snippets-private-container .checkbox-wrapper-7 .tgl {
    display: none;
}

.snippets-private-container .checkbox-wrapper-7 .tgl,
.snippets-private-container .checkbox-wrapper-7 .tgl:after,
.snippets-private-container .checkbox-wrapper-7 .tgl:before,
.snippets-private-container .checkbox-wrapper-7 .tgl *,
.snippets-private-container .checkbox-wrapper-7 .tgl *:after,
.snippets-private-container .checkbox-wrapper-7 .tgl *:before,
.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn {
    box-sizing: border-box;
}

.snippets-private-container .checkbox-wrapper-7 .tgl::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl:after::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl:before::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *:after::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *:before::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn::-moz-selection,
.snippets-private-container .checkbox-wrapper-7 .tgl::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl:after::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl:before::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *:after::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl *:before::selection,
.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn::selection {
    background: none;
}

.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn {
    outline: 0;
    display: block;
    width: 42px;
    height: 22px;
    position: relative;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn:after,
.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn:before {
    position: relative;
    display: block;
    content: "";
    width: 50%;
    height: 100%;
}

.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn:after {
    left: 0;
}

.snippets-private-container .checkbox-wrapper-7 .tgl + .tgl-btn:before {
    display: none;
}

.snippets-private-container .checkbox-wrapper-7 .tgl:checked + .tgl-btn:after {
    left: 50%;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios + .tgl-btn {
    background: #fbfbfb;
    border-radius: 2em;
    padding: 2px;
    transition: all 0.4s ease;
    border: 1px solid #e8eae9;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios + .tgl-btn:after {
    border-radius: 2em;
    background: #fbfbfb;
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), padding 0.3s ease, margin 0.3s ease;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 0 rgba(0, 0, 0, 0.08);
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios + .tgl-btn:hover:after {
    will-change: padding;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios + .tgl-btn:active {
    box-shadow: inset 0 0 0 2em #e8eae9;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios + .tgl-btn:active:after {
    padding-right: 0.8em;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios:checked + .tgl-btn {
    background: #86d993;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios:checked + .tgl-btn:active {
    box-shadow: none;
}

.snippets-private-container .checkbox-wrapper-7 .tgl-ios:checked + .tgl-btn:active:after {
    margin-left: -0.8em;
} 