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

:root {
    --primary-color: #00a8cc;
    --secondary-color: #005f73;
    --bg-dark: #000000;
    --bg-medium: #1a1a1a;
    --bg-light: #0a0a0a;
    --text-light: #ffffff;
    --text-dark: #a0a0a0;
    --html-color: #e34c26;
    --css-color: #264de4;
    --js-color: #f0db4f;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow: hidden;
}

body.light-theme {
    --bg-dark: #f5f5f5;
    --bg-medium: #ffffff;
    --bg-light: #e5e5e5;
    --text-light: #1a1a1a;
    --text-dark: #666666;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.app-header {
    background: #121212;
    padding: 15px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.logo i {
    font-size: 32px;
}

.logo span {
    font-size: 24px;
    font-weight: 600;
}

.logo p {
    font-size: 12px;
    opacity: 0.9;
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.desktop-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

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

/* Footer Styles */
.app-footer {
    background: #121212;
    padding: 10px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
    color: var(--text-dark);
    flex-shrink: 0;
}

.app-footer a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: var(--primary-color);
}

/* Policy Pages Styles */
/* Policy Pages Styles */
.policy-page {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow: auto;
    /* Enable scrolling */
}

.policy-page .app-container {
    height: auto;
    /* Allow container to grow with content */
    min-height: 100vh;
}

.policy-content {
    padding: 80px 20px 40px;
    /* Top padding to account for fixed header */
    min-height: calc(100vh - 60px);
    /* rough estimate for footer */
}

.policy-content .container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-medium);
    /* Using existing variable */
    padding: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Using a similar existing style */
}

.policy-content h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    /* Using a similar existing style */
    padding-bottom: 10px;
}

.policy-content strong {
    color: var(--text-light);
    /* Using existing variable */
    display: inline-block;
    margin-top: 10px;
}

.policy-content p {
    color: var(--text-dark);
    /* Using existing variable */
    margin-bottom: 15px;
}

.policy-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.policy-content a:hover {
    text-decoration: underline;
}

.back-btn {
    color: var(--text-dark);
    /* Using existing variable */
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
    margin-right: 20px;
}

.back-btn:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    /* Default: side-by-side on desktop */
    overflow: hidden;
    padding: 0;
    gap: 0;
}

.main-content.vertical {
    flex-direction: column;
}

.editors-container {
    display: flex;
    flex-direction: column;
    /* Stack vertically on desktop */
    gap: 0;
    flex: 1;
    min-width: 0;
}

.main-content.vertical .editors-container {
    flex: 0 0 50%;
    flex-direction: column;
    /* Keep vertical stacking */
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-medium);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.editor-pane:not(:last-child) {
    border-bottom: 1px solid var(--bg-dark);
}

.pane-header {
    padding: 12px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.pane-info {
    font-size: 12px;
    opacity: 0.8;
}

.html-header {}

.css-header {}

.js-header {}

.preview-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* CodeMirror Styles */
.editor-pane textarea,
.CodeMirror {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: none;
    background: var(--bg-light);
    color: var(--text-light);
    padding: 15px;
}

.CodeMirror {
    height: 100%;
}

.CodeMirror-gutters {
    background: var(--bg-medium);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Preview Container */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-medium);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    min-width: 0;
}

.preview-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.device-select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.device-select option {
    background: var(--bg-medium);
    color: var(--text-light);
}

.preview-wrapper {
    flex: 1;
    background: white;
    overflow: hidden;
    position: relative;
}

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    transition: width 0.3s ease;
}

/* Console Panel */
.console-panel {
    height: 0;
    background: var(--bg-light);
    border-top: 2px solid var(--primary-color);
    overflow: hidden;
    transition: height 0.3s ease;
    display: flex;
    flex-direction: column;
}

.console-panel.active {
    height: 200px;
}

.console-header {
    padding: 10px 15px;
    background: var(--bg-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.console-header span {
    display: flex;
    align-items: center;
    gap: 10px;
}

#close-console-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    transition: color 0.3s ease;
}

#close-console-btn:hover {
    color: var(--error-color);
}

.console-clear-btn {
    background: var(--error-color);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.3s ease;
}

.console-clear-btn:hover {
    opacity: 0.8;
}

.console-output {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
}

.console-log {
    padding: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-log.log {
    color: var(--text-light);
}

.console-log.error {
    color: var(--error-color);
}

.console-log.warn {
    color: var(--warning-color);
}

.console-log.info {
    color: #3b82f6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-medium);
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.template-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.template-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.template-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.template-card p {
    font-size: 12px;
    color: var(--text-dark);
}

/* Library List */
.library-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.library-item {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
}

.library-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.library-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-medium);
    color: var(--text-light);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--success-color);
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

/* Mobile Dropdown Menu */
.mobile-dropdown {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 250px;
    height: 100vh;
    background: var(--bg-medium);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-dropdown.active {
    transform: translateX(0);
}

.mobile-dropdown-content {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-menu-item {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 15px 20px;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-item i {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

/* Fullscreen Mode */
.preview-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    border-radius: 0;
    margin: 0;
}

.exit-fullscreen-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
    font-size: 14px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.exit-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(2px);
}

.preview-container.fullscreen .exit-fullscreen-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-medium);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

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

/* Thin scrollbar for toolbar on mobile */
.toolbar::-webkit-scrollbar {
    height: 4px;
}

.toolbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.toolbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Responsive Design */
.mobile-tabs {
    display: none;
}

@media (max-width: 1024px) {
    /* Keep desktop layout on tablets */
}

@media (max-width: 768px) {
    body:not(.policy-page):not(.snippets-page) {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .policy-page,
    .snippets-page {
        overflow: auto;
        height: auto;
    }

    .app-container {
        height: 100vh;
        overflow: hidden;
    }

    .policy-page .app-container,
    .snippets-page .app-container {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .app-header {
        height: 60px;
        padding: 0 15px;
        z-index: 20;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        gap: 8px;
    }

    .CodeMirror {
        font-size: 16px;
        /* Prevents auto-zoom on iOS */
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevents auto-zoom on iOS */
    }

    .logo i {
        font-size: 24px;
    }

    .logo span {
        font-size: 18px;
    }

    .logo p {
        display: none;
    }

    /* Toolbar tweaks */
    .toolbar {
        gap: 5px;
    }

    .mobile-menu-btn {
        display: flex !important;
        padding: 8px;
    }

    .desktop-toolbar {
        display: none;
    }

    .mobile-dropdown {
        display: block;
    }

    .app-footer {
        display: none;
    }

    .policy-page .app-footer,
    .snippets-page .app-footer {
        display: flex;
    }

    /* Main Content Layout */
    .main-content {
        position: absolute;
        top: 60px;
        /* Header height */
        bottom: 60px;
        /* Tab bar height */
        left: 0;
        right: 0;
        flex-direction: column !important;
        padding: 0;
        overflow: hidden;
    }

    /* Tabs Bar */
    .mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--bg-medium);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-tab {
        background: none;
        border: none;
        color: var(--text-dark);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 12px;
        padding: 8px;
        width: 100%;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-tab i {
        font-size: 18px;
        margin-bottom: 2px;
    }

    .mobile-tab.active {
        color: var(--primary-color);
        background: rgba(255, 255, 255, 0.05);
    }

    /* Editors & Preview Area */
    .editors-container {
        width: 100%;
        height: 100%;
        flex: 1;
        overflow: hidden;
    }

    .preview-container {
        width: 100%;
        height: 100%;
        flex: 1;
        min-height: 0;
        max-height: none;
        border: none;
        border-radius: 0;
        display: none;
        /* Hidden by default */
    }

    .preview-container.active {
        display: flex;
    }

    .editor-pane {
        width: 100%;
        height: 100%;
        display: none;
        /* Hidden by default */
        border: none;
        min-height: 0;
    }

    .editor-pane.active {
        display: flex;
    }

    .editor-pane .CodeMirror {
        height: 100% !important;
        min-height: 0;
    }

    .pane-header {
        display: none;
        /* Hide pane headers on mobile to save space, tabs serve this purpose */
    }

    /* Console tweaks for mobile */
    .console-panel.active {
        height: 40%;
        position: absolute;
        bottom: 0;
        width: 100%;
        z-index: 50;
    }

    /* Modal Tweaks */
    .modal-content {
        width: 95%;
        max-height: 80vh;
        margin: 0;
    }

    .preview-wrapper {
        height: 100%;
        flex: 1;
    }

    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: transparent;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 5px;
        z-index: 1510;
    }
}


/* ═══════════════════════════════════════════════
   SNIPPETS PAGE
═══════════════════════════════════════════════ */
.snippets-page {
    overflow: auto;
    background: var(--bg-dark);
}

.snippets-page .app-container {
    height: auto;
    min-height: 100vh;
}

.snip-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #050505;
}

/* Header */
.snip-header {
    background: #0d0d0d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 20px 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.snip-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.snip-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.back-link {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(-2px);
}

.snip-header-left h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.snip-header-left h1 i {
    color: var(--primary-color);
}

.snip-header-left p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.38);
    line-height: 1.4;
}

.snip-header-left p strong {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
}

.snip-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.snip-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 14px;
    transition: all 0.2s;
}

.snip-search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 168, 204, 0.12);
    background: rgba(0, 168, 204, 0.04);
}

.snip-search-box i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

.snip-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    padding: 10px 0;
    width: 220px;
    font-family: inherit;
}

.snip-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.snip-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}

/* Category Filters */
.snip-filters {
    display: flex;
    gap: 8px;
    padding: 16px 28px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

.cat-btn.active {
    background: rgba(0, 168, 204, 0.14);
    border-color: rgba(0, 168, 204, 0.4);
    color: var(--primary-color);
}

.cat-btn i {
    font-size: 12px;
}

/* Snippets Grid */
.snip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    padding: 24px 28px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Snippet Card */
.snip-card {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.snip-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.snip-card-header {
    padding: 16px 18px 14px;
}

.snip-cat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.cat-buttons    { background: rgba(102, 126, 234, 0.15); color: #a78bfa; }
.cat-forms      { background: rgba(0, 168, 204, 0.15);   color: var(--primary-color); }
.cat-login      { background: rgba(239, 68, 68, 0.15);   color: #f87171; }
.cat-cards      { background: rgba(16, 185, 129, 0.15);  color: #34d399; }
.cat-navigation { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }
.cat-landing    { background: rgba(236, 72, 153, 0.15);  color: #f472b6; }
.cat-loaders    { background: rgba(99, 102, 241, 0.15);  color: #818cf8; }
.cat-alerts     { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }

.snip-card-meta h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.snip-card-meta p {
    color: rgba(255, 255, 255, 0.38);
    font-size: 12px;
    line-height: 1.5;
}

/* Preview */
.snip-preview-wrap {
    position: relative;
    height: 240px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    background: #0a0a0a;
}

.snip-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    transform-origin: top left;
    pointer-events: none;
}

.snip-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.2s;
}

.snip-preview-overlay span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
    border-radius: 4px;
}

.snip-card:hover .snip-preview-overlay {
    opacity: 1;
}

/* Actions */
.snip-card-actions {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
}

.snip-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    flex: 1;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.open-btn {
    background: rgba(0, 168, 204, 0.1);
    border-color: rgba(0, 168, 204, 0.25);
    color: var(--primary-color);
    flex: 2;
}

.open-btn:hover {
    background: rgba(0, 168, 204, 0.2);
    border-color: rgba(0, 168, 204, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 168, 204, 0.25);
}

/* Empty State */
.snip-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
}

.snip-empty i {
    font-size: 48px;
    opacity: 0.3;
}

.snip-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.snip-empty p {
    font-size: 14px;
}

/* Toast Notification */
.snip-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e1e1e;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.snip-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.snip-toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

/* Snippets page responsive */
@media (max-width: 768px) {
    .snip-header { padding: 14px 16px; }
    .snip-header-inner { gap: 12px; }
    .snip-search-box input { width: 160px; }
    .snip-filters { padding: 12px 16px; gap: 6px; }
    .cat-btn { font-size: 12px; padding: 7px 12px; }
    .snip-grid { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
    .snip-preview-wrap { height: 200px; }
    .snip-header-right { width: 100%; }
    .snip-search-box { flex: 1; }
    .snip-search-box input { width: 100%; }
}

/* Loading Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}