/* ============================================================
   CodeLens Editor — All styling for index.php
   ============================================================ */

/* ====== VARIABLER ====== */
:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-code: #0d0d1a;
    --border-color: #2a2a4a;
    --text-light: #e0e0e0;
    --text-muted: #75715e;
    --color-html: #e94560;
    --color-css: #53d8fb;
    --color-js: #fd971f;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background: var(--bg-dark); color: var(--text-light); min-height: 100vh; }

/* ====== HEADER ====== */
.header {
    background: var(--bg-card);
    padding: 10px 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 10px;
}
.header .brand { color: #e94560; font-size: 1.3rem; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.header .brand span { color: #53d8fb; font-weight: 300; font-size: 0.9rem; }

.header .nav-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.header .nav-links a {
    color: #c4c4d4; text-decoration: none; padding: 5px 12px;
    border-radius: 6px; transition: all 0.3s; font-size: 0.85rem;
    display: inline-flex; align-items: center; gap: 5px;
}
.header .nav-links a:hover { background: #2a3a5e; color: #fff; }
.header .nav-links a.active { background: #2a3a5e; color: #e94560; }

/* Prosjekt-velger-knapp */
.btn-project-selector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(108, 92, 231, 0.1));
    color: #a29bfe;
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-project-selector:hover {
    background: rgba(108, 92, 231, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}
.btn-project-selector .project-name {
    font-family: 'Courier New', monospace;
    direction: ltr;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}
.btn-project-selector .fa-chevron-down { font-size: 0.7rem; opacity: 0.7; }

.project-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(166, 226, 46, 0.1);
    border: 1px solid rgba(166, 226, 46, 0.3);
    color: #a6e22e;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
}
.project-indicator strong {
    font-family: 'Courier New', monospace;
    direction: ltr;
    color: #fff;
}

.container-main { padding: 15px; max-width: 1600px; margin: 0 auto; }

/* ====== TOOLBAR ====== */
.toolbar {
    display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px;
    padding: 10px 15px; background: var(--bg-card);
    border-radius: 12px; border: 1px solid var(--border-color);
    align-items: center;
}
.toolbar .btn {
    padding: 6px 18px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 0.85rem; transition: all 0.3s;
    text-decoration: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.toolbar .btn-primary { background: var(--color-html); color: #fff; }
.toolbar .btn-primary:hover { background: #c73652; transform: scale(1.02); }
.toolbar .btn-success { background: var(--color-css); color: #1a1a2e; }
.toolbar .btn-success:hover { background: #3ac0e0; transform: scale(1.02); }
.toolbar .btn-info { background: #17a2b8; color: #fff; }
.toolbar .btn-info:hover { background: #138496; transform: scale(1.02); }
.toolbar .btn-warning { background: var(--color-js); color: #1a1a2e; }
.toolbar .btn-warning:hover { background: #e0861a; transform: scale(1.02); }
.toolbar .btn-outline { background: transparent; color: #c4c4d4; border: 1px solid var(--border-color); }
.toolbar .btn-outline:hover { background: #2a3a5e; color: #fff; }
.toolbar .btn-undo { background: #fd971f; color: #1a1a2e; }
.toolbar .btn-undo:hover { background: #e0861a; transform: scale(1.02); }
.toolbar .btn-history { background: #a6e22e; color: #1a1a2e; }
.toolbar .btn-history:hover { background: #8cc41a; transform: scale(1.02); }
.toolbar .btn-reset-partial { background: #ae81ff; color: #1a1a2e; }
.toolbar .btn-reset-partial:hover { background: #9670e6; transform: scale(1.02); }
.toolbar .btn-reset-full { background: #ff6b6b; color: #fff; }
.toolbar .btn-reset-full:hover { background: #e05555; transform: scale(1.02); }
.toolbar .btn-lukk-alle { background: #2a2a4a; color: #c4c4d4; }
.toolbar .btn-lukk-alle:hover { background: #3a3a5a; }
.toolbar .status { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }
.toolbar .status .saved { color: #53d8fb; }
.toolbar .status .unsaved { color: #fd971f; }

/* ====== PANELER ====== */
.panel-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.panel-item {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel-item .panel-header {
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.panel-item .panel-header:hover { background: rgba(255,255,255,0.03); }

.panel-item .panel-header .label {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.panel-item .panel-header .label.html { color: var(--color-html); }
.panel-item .panel-header .label.css { color: var(--color-css); }
.panel-item .panel-header .label.js { color: var(--color-js); }

.panel-item .panel-header .badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    padding: 2px 12px;
    border-radius: 12px;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Øye-knapp */
.btn-eye {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    font-size: 0.9rem;
    padding: 0;
    font-family: inherit;
    border: 1px solid;
}

.panel-item.html-panel .btn-eye {
    background: rgba(233, 69, 96, 0.1);
    border-color: rgba(233, 69, 96, 0.3);
    color: #e94560;
}
.panel-item.html-panel .btn-eye:hover {
    background: #e94560;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.panel-item.css-panel .btn-eye {
    background: rgba(83, 216, 251, 0.1);
    border-color: rgba(83, 216, 251, 0.3);
    color: #53d8fb;
}
.panel-item.css-panel .btn-eye:hover {
    background: #53d8fb;
    color: #1a1a2e;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(83, 216, 251, 0.4);
}

.panel-item.js-panel .btn-eye {
    background: rgba(253, 151, 31, 0.1);
    border-color: rgba(253, 151, 31, 0.3);
    color: #fd971f;
}
.panel-item.js-panel .btn-eye:hover {
    background: #fd971f;
    color: #1a1a2e;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(253, 151, 31, 0.4);
}

.panel-item .panel-header .toggle-icon {
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform 0.3s ease;
    width: 32px;
    height: 32px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.panel-item .panel-header .toggle-icon:hover {
    background: rgba(255,255,255,0.05);
}

.panel-item .panel-header .toggle-icon.open { transform: rotate(180deg); }

.panel-item .panel-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 0;
}

.panel-item.open .panel-body {
    max-height: 400px;
    padding: 0 0 0 0;
}

.panel-item.open .panel-header { border-bottom-color: var(--border-color); }
.panel-item.html-panel.open .panel-header { border-bottom-color: var(--color-html); }
.panel-item.css-panel.open .panel-header { border-bottom-color: var(--color-css); }
.panel-item.js-panel.open .panel-header { border-bottom-color: var(--color-js); }

/* CodeMirror */
.panel-item .CodeMirror {
    height: 250px !important;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg-code) !important;
}

.panel-item .CodeMirror-gutters {
    background: var(--bg-code) !important;
    border-right: 1px solid var(--border-color) !important;
}

.panel-item .CodeMirror-linenumber { color: var(--text-muted) !important; }
.panel-item .CodeMirror-cursor { border-left: 2px solid #f8f8f2 !important; }
.panel-item .CodeMirror-selected { background: #e9456040 !important; }
.panel-item .CodeMirror-focused .CodeMirror-selected { background: #e9456060 !important; }

.cm-s-monokai .cm-tag { color: #f92672; }
.cm-s-monokai .cm-attribute { color: #a6e22e; }
.cm-s-monokai .cm-string { color: #e6db74; }
.cm-s-monokai .cm-comment { color: #75715e; }
.cm-s-monokai .cm-keyword { color: #66d9ef; }
.cm-s-monokai .cm-variable { color: #fd971f; }
.cm-s-monokai .cm-number { color: #ae81ff; }
.cm-s-monokai .cm-def { color: #a6e22e; }
.cm-s-monokai .cm-property { color: #66d9ef; }
.cm-s-monokai .cm-operator { color: #f92672; }

/* ====== PREVIEW ====== */
.preview-container {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 450px;
    position: relative;
    transition: height 0.3s ease;
}

.preview-container.full { height: 550px; }
.preview-container iframe { width: 100%; height: 100%; border: none; background: #fff; }

.preview-label {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(26, 26, 46, 0.8);
    color: var(--text-muted);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    pointer-events: none;
    backdrop-filter: blur(5px);
}

/* ====== INFO BANNER ====== */
.info-banner {
    margin-top: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    align-items: center;
}
.info-banner .color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 4px;
}
.info-banner .color-dot.html { background: #f92672; }
.info-banner .color-dot.css { background: #a6e22e; }
.info-banner .color-dot.js { background: #fd971f; }
.info-banner .color-dot.value { background: #e6db74; }
.info-banner .color-dot.comment { background: #75715e; }

/* ====== TOAST ====== */
.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2a3a5e;
    color: #e0e0e0;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 99999;
    animation: slideUp 0.3s ease;
    max-width: 450px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}
.toast-message.success { background: #2d5a4e; }
.toast-message.error { background: #5a2a4e; }
.toast-message.warning { background: #5a4a2e; }
.toast-message.info { background: #2a4a5e; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ====== MODAL ====== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 750px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-content .modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}
.modal-content .modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-content .modal-header .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 8px;
    transition: all 0.3s;
    line-height: 1;
}
.modal-content .modal-header .close-btn:hover { color: var(--color-html); transform: rotate(90deg); }
.modal-content .modal-body {
    padding: 15px 20px;
    flex: 1;
    overflow: auto;
}

/* History item */
.history-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.history-item:last-child { border-bottom: none; }
.history-item .info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 120px;
}
.history-item .date { color: var(--text-muted); font-size: 0.75rem; }
.history-item .version-badge {
    background: var(--bg-dark);
    padding: 1px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--color-css);
    width: fit-content;
}
.history-item .preview {
    color: var(--text-light);
    font-size: 0.85rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-item .actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.history-item .actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s;
    font-family: inherit;
}
.history-item .actions .restore-btn { background: var(--color-css); color: #1a1a2e; }
.history-item .actions .restore-html { background: #f92672; color: #fff; }
.history-item .actions .restore-css { background: #a6e22e; color: #1a1a2e; }
.history-item .actions .restore-js { background: #fd971f; color: #1a1a2e; }
.history-item .actions .delete-btn { background: #e94560; color: #fff; }
.history-item .actions button:hover { transform: scale(1.05); }
.empty-history { text-align: center; color: var(--text-muted); padding: 40px 20px; }

.modal-content .modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    justify-content: flex-end;
}
.modal-content .modal-footer .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    font-family: inherit;
}
.modal-content .modal-footer .btn-reset-full-modal { background: #ff6b6b; color: #fff; }
.modal-content .modal-footer .btn-reset-full-modal:hover { background: #e05555; }
.modal-content .modal-footer .btn-close-modal { background: var(--border-color); color: var(--text-light); }
.modal-content .modal-footer .btn-close-modal:hover { background: #3a4a6e; }

/* ====== PROSJEKT-MODAL ====== */
.project-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}
.project-modal-overlay.show { display: flex; }

.project-modal {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), transparent);
}

.project-modal-header h3 {
    color: #fff;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.project-modal-header h3 i { color: #a29bfe; }

.project-modal-header .count-badge {
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: 10px;
}

.project-modal-header .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}
.project-modal-header .close-btn:hover { color: var(--color-html); transform: rotate(90deg); }

.project-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.project-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.project-modal-card {
    background: var(--bg-code);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 18px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-modal-card:hover {
    border-color: #6c5ce7;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(108, 92, 231, 0.25);
}

.project-modal-card.active {
    border-color: #a6e22e;
    background: linear-gradient(160deg, var(--bg-code), rgba(166, 226, 46, 0.08));
    box-shadow: 0 0 0 1px rgba(166, 226, 46, 0.3), 0 10px 30px rgba(166, 226, 46, 0.15);
}

.project-modal-card .pm-active-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #a6e22e;
    color: #1a1a2e;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-modal-card .pm-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.project-modal-card:hover .pm-icon {
    transform: scale(1.1) rotate(-8deg);
    background: rgba(108, 92, 231, 0.25);
}

.project-modal-card h4 {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    direction: ltr;
    text-align: right;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-modal-card .pm-tag {
    display: inline-block;
    background: rgba(83, 216, 251, 0.15);
    color: #53d8fb;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    width: fit-content;
}

.project-modal-card .pm-files {
    display: flex;
    gap: 6px;
    align-items: center;
}

.project-modal-card .pm-file-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.project-modal-card .pm-file-dot.present {
    background: #a6e22e;
    box-shadow: 0 0 8px rgba(166, 226, 46, 0.6);
}

.project-modal-card .pm-file-dot.missing {
    background: rgba(117, 113, 94, 0.4);
    border: 1px solid rgba(117, 113, 94, 0.6);
}

/* ====== FULLSKJERM-EDITOR ====== */
.fullscreen-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    padding: 15px;
    animation: fadeIn 0.25s ease;
}

.fullscreen-modal.show {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 14px 14px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    flex-wrap: wrap;
    gap: 12px;
}

.fs-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.fs-modal-title i { font-size: 1.4rem; }
.fs-modal-title.html { color: #e94560; }
.fs-modal-title.css { color: #53d8fb; }
.fs-modal-title.js { color: #fd971f; }

.fs-modal-title .filename {
    color: #a0a0b0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    direction: ltr;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 12px;
    border-radius: 8px;
    margin-right: 10px;
}

.fs-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fs-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s;
}

.fs-btn-save { background: #a6e22e; color: #1a1a2e; }
.fs-btn-save:hover {
    background: #8cc41a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(166, 226, 46, 0.4);
}

.fs-btn-copy {
    background: rgba(83, 216, 251, 0.15);
    color: #53d8fb;
    border: 1px solid rgba(83, 216, 251, 0.3);
}
.fs-btn-copy:hover {
    background: #53d8fb;
    color: #1a1a2e;
    transform: translateY(-2px);
}

.fs-btn-close {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.3);
}
.fs-btn-close:hover {
    background: #e94560;
    color: #fff;
    transform: translateY(-2px);
}

.fs-modal-body {
    flex: 1;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.fs-modal-body .CodeMirror {
    height: 100% !important;
    width: 100% !important;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.8;
    background: var(--bg-code) !important;
}

.fs-modal-body .CodeMirror-gutters {
    background: var(--bg-code) !important;
    border-right: 1px solid var(--border-color) !important;
    padding-right: 8px;
}

.fs-modal-body .CodeMirror-linenumber {
    color: var(--text-muted) !important;
    font-size: 13px;
}

.fs-modal-body .CodeMirror-lines {
    padding: 15px 0;
}

.fs-modal-info {
    padding: 10px 25px;
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 10px;
}

.fs-modal-info .chars-count {
    font-family: 'Courier New', monospace;
    color: #53d8fb;
    font-weight: 600;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .container-main { padding: 10px; }
    .panel-item .CodeMirror { height: 180px !important; font-size: 12px; }
    .preview-container { height: 300px; }
    .preview-container.full { height: 400px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .status { margin-left: 0; text-align: center; }
    .info-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
    .modal-content { max-height: 95vh; margin: 10px; }
    .history-item .preview { max-width: 120px; }
    .project-modal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .project-modal-card { padding: 15px 12px; }
    .project-modal-card h4 { font-size: 0.85rem; }
    .fullscreen-modal { padding: 8px; }
    .fs-modal-header { padding: 12px 15px; }
    .fs-modal-title { font-size: 0.95rem; }
    .fs-btn { padding: 6px 12px; font-size: 0.75rem; }
    .fs-modal-body .CodeMirror { font-size: 13px; }
}

::-webkit-scrollbar { width: 6px; background: var(--bg-code); }
::-webkit-scrollbar-thumb { background: #3a4a6e; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #5a7a9a; }

/* ============================================================
   FULLSKJERM-OVERLAY — Dekker hele skjermen
   ============================================================ */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0d1a;
    z-index: 999999;
    flex-direction: column;
}

.fullscreen-overlay.show {
    display: flex;
}

/* Header */
.fs-header {
    background: #16213e;
    padding: 15px 25px;
    border-bottom: 2px solid #2a2a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.fs-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.fs-title i {
    font-size: 1.4rem;
}

.fs-title.html { color: #e94560; }
.fs-title.css { color: #53d8fb; }
.fs-title.js { color: #fd971f; }

.fs-title .fs-filename {
    color: #a0a0b0;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 14px;
    border-radius: 8px;
    direction: ltr;
}

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

.fs-action-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s;
}

.fs-btn-save {
    background: #a6e22e;
    color: #1a1a2e;
}
.fs-btn-save:hover {
    background: #8cc41a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(166, 226, 46, 0.4);
}

.fs-btn-copy {
    background: rgba(83, 216, 251, 0.15);
    color: #53d8fb;
    border: 1px solid rgba(83, 216, 251, 0.3);
}
.fs-btn-copy:hover {
    background: #53d8fb;
    color: #1a1a2e;
    transform: translateY(-2px);
}

.fs-btn-close {
    background: rgba(233, 69, 96, 0.15);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.3);
}
.fs-btn-close:hover {
    background: #e94560;
    color: #fff;
    transform: translateY(-2px);
}

/* Editor container */
.fs-editor-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #0d0d1a;
    min-height: 0;
}

.fs-editor-container .CodeMirror {
    height: 100% !important;
    width: 100% !important;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.8;
    background: #0d0d1a !important;
    direction: ltr;
    text-align: left;
}

.fs-editor-container .CodeMirror-gutters {
    background: #0d0d1a !important;
    border-right: 1px solid #2a2a4a !important;
    padding-right: 10px;
}

.fs-editor-container .CodeMirror-linenumber {
    color: #75715e !important;
    font-size: 13px;
}

.fs-editor-container .CodeMirror-lines {
    padding: 20px 0;
}

.fs-editor-container .CodeMirror-cursor {
    border-left: 2px solid #f8f8f2 !important;
}

/* Footer */
.fs-footer {
    background: #16213e;
    padding: 12px 25px;
    border-top: 1px solid #2a2a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: #75715e;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.fs-footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-footer-info i {
    color: #53d8fb;
}

.fs-counters {
    display: flex;
    gap: 20px;
    font-family: 'Courier New', monospace;
    color: #53d8fb;
    font-weight: 600;
}

.fs-counters span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .fs-header {
        padding: 12px 15px;
    }
    .fs-title {
        font-size: 0.95rem;
    }
    .fs-title .fs-filename {
        font-size: 0.72rem;
        padding: 3px 10px;
    }
    .fs-action-btn {
        padding: 7px 12px;
        font-size: 0.78rem;
    }
    .fs-editor-container .CodeMirror {
        font-size: 13px;
    }
    .fs-footer {
        padding: 10px 15px;
        font-size: 0.75rem;
    }
    .fs-counters {
        gap: 12px;
    }
}