:root {
    --bg-color: #11111b; 
    --text-color: #cdd6f4;
    --border-active: #89b4fa; 
    --border-inactive: #313244;
    --bar-bg: #181825;
    --gaps-in: 8px;
    --gaps-out: 16px;
    --border-width: 2px;
    --border-radius: 8px; 
    --split-pos: 35%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#waybar {
    background-color: var(--bar-bg);
    display: flex;
    justify-content: space-between;
    padding: 4px 16px;
    font-size: 0.9rem;
    border-bottom: var(--border-width) solid var(--border-inactive);
}

.workspace-btn {
    padding: 4px 12px;
    margin-right: 4px;
    border-radius: 4px;
    color: #6c7086;
    transition: all 0.2s ease;
    cursor: pointer;
}

.workspace-btn.active {
    background-color: var(--border-inactive);
    color: var(--text-color);
}

.tray-icon {
    color: var(--text-color);
    margin-right: 12px;
    display: flex;
    align-items: center;
    transition: opacity 0.2s ease;
}

.tray-icon:hover {
    opacity: 0.7;
}

#hypr-workspace {
    flex-grow: 1;
    padding: var(--gaps-out);
    position: relative;
}

.window {
    position: absolute;
    top: var(--gaps-out);
    left: var(--gaps-out);
    right: var(--gaps-out);
    bottom: var(--gaps-out);
    background-color: #1e1e2e;
    border: var(--border-width) solid var(--border-inactive);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.window-content {
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.window.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.window.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    border-color: var(--border-active); 
    box-shadow: 0 0 5px rgba(137, 180, 250, 0.6), 0 0 15px rgba(137, 180, 250, 0.3), inset 0 0 8px rgba(137, 180, 250, 0.15);
}

.window.split-left { 
    right: calc(100% - var(--split-pos) + (var(--gaps-in) / 2)); 
}

.window.split-right { 
    left: calc(var(--split-pos) + (var(--gaps-in) / 2)); 
}

.resizer {
    position: absolute;
    top: var(--gaps-out);
    bottom: var(--gaps-out);
    left: calc(var(--split-pos) - 8px); 
    width: 16px;
    cursor: col-resize;
    z-index: 50;
    display: none;
}

.resizer.active {
    display: block;
}

.resizer:hover, body.is-dragging .resizer {
    background-color: rgba(137, 180, 250, 0.15); 
}

body.is-dragging .window {
    transition: none !important;
    user-select: none;
}

h1 { font-size: 1.4rem; color: var(--border-active); margin-bottom: 1.5rem; }
h2 { font-size: 1.1rem; color: var(--text-color); margin-bottom: 0px; line-height: 1.3;}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    transition: all 0.3s ease;
    padding: 8px; 
}

.left-pane h1 {
    margin-left: 8px;
}

.window.split-left .service-grid { grid-template-columns: 1fr; }

/* Fixed Service Card Overflow Constraints */
.service-card {
    background-color: #181825;
    border: 1px solid var(--border-inactive);
    border-radius: 6px;
    padding: 1.25rem;
    padding-bottom: 3.5rem; 
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.service-card:focus {
    border-color: var(--border-active);
    background-color: #11111b;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    outline: none;
}

.service-card:hover .card-action,
.service-card:focus .card-action { 
    color: #a6e3a1; 
}

.service-card.selected { border-color: var(--border-inactive); background-color: #11111b; }

.service-header { display: flex; align-items: center; margin-bottom: 0.75rem; }

.service-desc { color: #bac2de; font-size: 0.9rem; line-height: 1.5; margin-bottom: 1rem; flex-grow: 1; }
.service-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.service-tags span { font-size: 0.75rem; color: var(--border-active); background-color: rgba(137, 180, 250, 0.1); padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(137, 180, 250, 0.2); }

.card-action {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    font-size: 0.85rem;
    color: #585b70; 
    transition: all 0.2s ease;
}

.service-card:hover .card-action { 
    color: #a6e3a1; 
}

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

.close-btn {
    background: none; border: none; color: #f38ba8; font-family: inherit; font-size: 0.9rem;
    cursor: pointer; margin-bottom: 1.5rem; display: block; transition: color 0.2s;
}
.close-btn:hover { text-decoration: underline; color: #eba0ac; }

.pdf-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.pdf-toolbar h1 {
    margin-bottom: 0;
}

.download-btn {
    color: var(--border-active);
    text-decoration: none;
    border: 1px solid var(--border-inactive);
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.download-btn:hover {
    background-color: var(--border-inactive);
    color: var(--text-color);
}

.canvas-wrapper {
    flex-grow: 1;
    background-color: #11111b; 
    border: 1px solid var(--border-inactive);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
}

.native-pdf {
    width: 100%;
    height: 100%;
    border: none;
    display: block; 
}

/* --- Window 4: TUI Base --- */
.tui-wrapper {
    background-color: #000000; /* AMOLED Black */
    color: #cccccc;            /* Standard Terminal White/Gray */
    height: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    cursor: text;
}

/* Nuke the Browser's Default Input Box and enforce terminal aesthetic */
#tui-input {
    background-color: transparent !important;
    border: none !important;
    color: #cccccc !important; 
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    caret-color: #00ff00; 
}

/* Standard Terminal Rules */
#terminal-output { 
    display: flex; 
    flex-direction: column; 
    white-space: pre-wrap; 
    word-break: break-all; 
    line-height: 1.4;
}

.terminal-input-line { 
    display: flex; 
    align-items: center; 
    margin-top: 0.5rem; 
}

.prompt { 
    margin-right: 0.75rem; 
    white-space: nowrap; 
}
