/* ============================================
   DeepSite - Custom Styles
   ============================================ */

/* ---- Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- CodeMirror Overrides ---- */
.CodeMirror {
    height: 100% !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    background: #0a0a14 !important;
    color: #e0e0e0 !important;
    padding: 0;
}

.CodeMirror-gutters {
    background: #0a0a14 !important;
    border-right: 1px solid #14142a !important;
    padding-right: 4px;
}

.CodeMirror-linenumber {
    color: #2e2e52 !important;
    font-size: 11px !important;
    padding: 0 6px 0 8px !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #10b981 !important;
}

.CodeMirror-selected {
    background: rgba(16, 185, 129, 0.08) !important;
}

.CodeMirror-focused .CodeMirror-selected {
    background: rgba(16, 185, 129, 0.12) !important;
}

.CodeMirror-activeline-background {
    background: rgba(255, 255, 255, 0.02) !important;
}

.CodeMirror-matchingbracket {
    color: #34d399 !important;
    text-decoration: underline;
}

.CodeMirror-scrollbar-filler {
    background: transparent !important;
}

/* Syntax Colors for material-darker theme overrides */
.cm-s-material-darker .cm-tag {
    color: #f07178 !important;
}

.cm-s-material-darker .cm-attribute {
    color: #ffcb6b !important;
}

.cm-s-material-darker .cm-string {
    color: #c3e88d !important;
}

.cm-s-material-darker .cm-keyword {
    color: #c792ea !important;
}

.cm-s-material-darker .cm-def {
    color: #82aaff !important;
}

.cm-s-material-darker .cm-number {
    color: #f78c6c !important;
}

.cm-s-material-darker .cm-comment {
    color: #546e7a !important;
}

.cm-s-material-darker .cm-property {
    color: #82aaff !important;
}

.cm-s-material-darker .cm-variable {
    color: #eeffff !important;
}

.cm-s-material-darker .cm-variable-2 {
    color: #eeffff !important;
}

.cm-s-material-darker .cm-operator {
    color: #89ddff !important;
}

/* ---- Suggestion Chips ---- */
.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 9999px;
    color: #6ee7b7;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Inter', system-ui, sans-serif;
}

.suggestion-chip:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
    transform: translateY(-1px);
}

.suggestion-chip:active {
    transform: translateY(0);
}

.suggestion-chip i {
    opacity: 0.7;
}

/* ---- Mobile Tabs ---- */
.mobile-tab {
    color: #4b5563;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.mobile-tab.active {
    color: #34d399;
    border-bottom-color: #10b981;
}

/* ---- Toast Notifications ---- */
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 340px;
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    font-family: 'Inter', system-ui, sans-serif;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.toast-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

.toast-info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

/* ---- Loading Spinner ---- */
.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid #1a1a2e;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Progress Bar Shimmer ---- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.generating #progressFill {
    width: 100% !important;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-thumb {
    background: #1e1e3a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e2e4e;
}

/* CodeMirror scrollbar */
.CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
    background: #1e1e3a;
    border-radius: 3px;
}

/* ---- Prompt Textarea ---- */
#promptInput {
    min-height: 40px;
    max-height: 140px;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 767px) {
    #splitContainer {
        flex-direction: column;
    }

    #editorPanel,
    #previewPanel {
        width: 100% !important;
        flex: none;
    }

    #editorPanel[data-hidden="true"],
    #previewPanel[data-hidden="true"] {
        display: none !important;
    }

    #resizeHandle {
        display: none !important;
    }

    .suggestion-chip {
        font-size: 10px;
        padding: 2px 8px;
    }
}

/* ---- Selection ---- */
::selection {
    background: rgba(16, 185, 129, 0.25);
    color: #e0e0e0;
}

/* ---- Focus Ring ---- */
*:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.4);
    outline-offset: 1px;
    border-radius: 4px;
}

/* ---- Generate Button Animation ---- */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); }
    50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.3); }
}

#generateBtn:not(:disabled):hover {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ---- Empty Preview Placeholder ---- */
.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    color: #94a3b8;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Smooth Transitions ---- */
#editorPanel, #previewPanel {
    transition: width 0.01s;
}