/* ============================================================
   Brose Engineering – styles.css
   Theme: Dracula-inspired IDE Dark Theme
   Font:  Fira Code (monospace with ligatures)
   ============================================================ */

/* ---------- CSS Variables (Dracula Palette) ---------- */
:root {
    --bg-dark:        #1e1f29;
    --bg-editor:      #282a36;
    --bg-titlebar:    #21222c;
    --bg-terminal:    #191a23;
    --bg-gutter:      #21222c;
    --border-color:   #44475a;
    --accent:         #8be9fd;   /* Cyan */
    --accent-hover:   #62d6f7;
    --purple:         #bd93f9;
    --green:          #50fa7b;
    --yellow:         #f1fa8c;
    --orange:         #ffb86c;
    --red:            #ff5555;
    --pink:           #ff79c6;
    --comment:        #6272a4;
    --fg:             #f8f8f2;
    --fg-muted:       #8892a4;
    --dot-close:      #ff5f57;
    --dot-min:        #febc2e;
    --dot-max:        #28c840;
    --radius:         10px;
    --radius-sm:      6px;
    --font-mono:      'Fira Code', 'Courier New', monospace;
    --font-ui:        'Oswald', 'Arial', sans-serif;
    --transition:     0.25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-mono);
    background-color: var(--bg-dark);
    color: var(--fg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Header ---------- */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 20px 12px;
}

.header-image {
    width: 100%;
    max-width: 480px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: brightness(92%) opacity(90%);
    transition: filter var(--transition);
}

.header-image:hover {
    filter: brightness(100%) opacity(100%);
}

/* ---------- Main ---------- */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 16px 32px;
    width: 100%;
}

/* ---------- Editor Window ---------- */
.editor-window {
    background-color: var(--bg-editor);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 820px;
    box-shadow:
        0 0 0 1px rgba(68, 71, 90, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(139, 233, 253, 0.04);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.editor-window:hover {
    box-shadow:
        0 0 0 1px rgba(139, 233, 253, 0.25),
        0 12px 48px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(139, 233, 253, 0.08);
}

/* ---------- IDE Title Bar ---------- */
.editor-titlebar {
    display: flex;
    align-items: center;
    background-color: var(--bg-titlebar);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    gap: 12px;
}

.titlebar-buttons {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.btn-close-dot,
.btn-minimize-dot,
.btn-maximize-dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    transition: filter var(--transition);
}

.btn-close-dot    { background-color: var(--dot-close); }
.btn-minimize-dot { background-color: var(--dot-min); }
.btn-maximize-dot { background-color: var(--dot-max); }

.titlebar-buttons:hover .btn-close-dot    { filter: brightness(1.2); }
.titlebar-buttons:hover .btn-minimize-dot { filter: brightness(1.2); }
.titlebar-buttons:hover .btn-maximize-dot { filter: brightness(1.2); }

.titlebar-filename {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--fg-muted);
    letter-spacing: 0.02em;
}

.file-icon {
    color: var(--yellow);
    margin-right: 5px;
    font-size: 0.9rem;
}

.titlebar-spacer {
    width: 60px;
    flex-shrink: 0;
}

/* ---------- Profile Section ---------- */
.editor-profile-section {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border-color);
}

.profile-img-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border-color);
    display: block;
    transition: border-color var(--transition);
}

.editor-window:hover .profile-img {
    border-color: var(--accent);
}

.profile-status {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    background-color: var(--green);
    border-radius: 50%;
    border: 2px solid var(--bg-editor);
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-name {
    font-family: var(--font-ui);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 0.03em;
}

.profile-role {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.04em;
}

/* ---------- Editor Body (Code + Gutter) ---------- */
.editor-body {
    display: flex;
    overflow-x: auto;
    background-color: var(--bg-editor);
}

.line-numbers {
    background-color: var(--bg-gutter);
    color: var(--comment);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    padding: 20px 14px 20px 16px;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border-color);
    min-width: 48px;
    flex-shrink: 0;
    white-space: pre;
}

.code-content {
    flex: 1;
    background-color: transparent;
    padding: 20px 24px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    white-space: pre;
    overflow-x: visible;
    font-variant-ligatures: contextual;
}

#codeBlock {
    font-family: var(--font-mono);
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
}

/* ---------- Syntax Highlighting (Dracula) ---------- */
.kw    { color: var(--pink); }        /* keywords: def, if, from, import */
.fn    { color: var(--green); }       /* function names */
.cls   { color: var(--purple); }      /* class names */
.str   { color: var(--yellow); }      /* strings */
.num   { color: var(--purple); }      /* numbers */
.var   { color: var(--fg); }          /* variables */
.cmt   { color: var(--comment); font-style: italic; }  /* comments */
.dec   { color: var(--green); }       /* decorators */
.bi    { color: var(--cyan, #8be9fd); color: var(--accent); }  /* builtins */
.op    { color: var(--pink); }        /* operators */
.punc  { color: var(--fg-muted); }    /* punctuation */
.param { color: var(--orange); }      /* parameters */
.type  { color: var(--cyan, #8be9fd); color: var(--accent); }  /* type hints */

/* ---------- Cursor Blink ---------- */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--accent);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
    margin-left: 1px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ---------- Terminal Panel ---------- */
.terminal-panel {
    border-bottom: 2px solid var(--green);
    background-color: var(--bg-terminal);
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(80, 250, 123, 0.12);
}

.terminal-panel.visible {
    display: flex;
    animation: terminal-appear 0.4s ease;
}

@keyframes terminal-appear {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: var(--bg-titlebar);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.terminal-title {
    color: var(--green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.04em;
}

.terminal-run-hint {
    color: var(--comment);
    font-style: italic;
}

.terminal-output {
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--fg);
    white-space: pre-wrap;
    min-height: 60px;
}

.terminal-output .t-prompt {
    color: var(--green);
    opacity: 0.7;
}

.terminal-output .t-cmd {
    color: var(--fg);
    opacity: 0.7;
}

/* Ausgabe-Zeilen: groß, hell, gut lesbar */
.terminal-output .t-out {
    color: var(--fg);
    font-size: 1rem;
    font-weight: 500;
    display: block;
    background: linear-gradient(90deg, rgba(139,233,253,0.07) 0%, transparent 100%);
    border-left: 3px solid var(--accent);
    padding: 4px 10px;
    margin: 2px 0;
    border-radius: 0 4px 4px 0;
}

.terminal-output .t-warn {
    color: var(--orange);
    font-size: 0.88rem;
    display: block;
    padding: 2px 10px;
    border-left: 3px solid var(--orange);
    margin: 2px 0;
    border-radius: 0 4px 4px 0;
    opacity: 0.85;
}

/* ---------- Footer ---------- */
footer {
    background-color: var(--bg-titlebar);
    padding: 18px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.footer-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.footer-icon-link {
    color: var(--fg-muted);
    font-size: 1.3rem;
    text-decoration: none;
    transition: color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
}

.footer-icon-link:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .editor-profile-section {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 16px 12px;
    }

    .code-content {
        font-size: 0.78rem;
        padding: 16px 14px;
    }

    .line-numbers {
        font-size: 0.78rem;
        padding: 16px 10px 16px 10px;
        min-width: 36px;
    }

    .titlebar-filename {
        font-size: 0.75rem;
    }

    .profile-name {
        font-size: 1.1rem;
    }
}
