:root {
    --font-main: 'Outfit', sans-serif;

    /* Color Palette - Premium Dark */
    --color-bg-base: #0f172a;
    --color-bg-surface: #1e293b;
    --color-bg-glass: rgba(30, 41, 59, 0.7);

    --color-primary: #3b82f6;
    --color-primary-glow: rgba(59, 130, 246, 0.5);

    --color-accent: #8b5cf6;

    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;

    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    font-family: var(--font-main);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

.layout-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    margin: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand h1 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 700;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: white;
    background: rgba(59, 130, 246, 0.15);
    font-weight: 600;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

main {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.content-panel {
    min-height: 100%;
    padding: 32px;
    position: relative;
    box-sizing: border-box;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--color-primary-glow);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--color-primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.badge-green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.user {
    align-self: flex-end;
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.system {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    padding: 8px;
    font-family: inherit;
}

/* Grid & Layouts */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.file-item {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    transition: transform 0.2s;
}

.file-item:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.03);
}

.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.template-card {
    padding: 24px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card.selected {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.1);
}

.template-card.upload-new {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-muted);
}

.template-card.upload-new:hover {
    border-color: var(--color-text-main);
    color: var(--color-text-main);
}

/* Phase Stepper */
.phase-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 6px;
    position: relative;
    overflow: hidden;
}

.phase-item {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    position: relative;
    transition: all 0.3s ease;
    cursor: default;
    font-weight: 500;
}

.phase-item.active {
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.phase-item.completed {
    color: #fff;
}

/* Deliverables Matrix */
.deliverables-matrix {
    margin-top: 32px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

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

.deliverable-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-created {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.status-progress {
    background: #fbbf24;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.status-omitted {
    background: #4b5563;
}

.status-pending {
    background: rgba(255, 255, 255, 0.2);
}

/* Pendenzen List */
.task-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--color-text-muted);
    margin-right: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.task-item.done .task-checkbox {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.task-item.done .task-text {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

/* HERMES Overview Matrix */
.hermes-matrix-container {
    overflow-x: auto;
    padding-bottom: 24px;
}

.hermes-matrix {
    display: grid;
    grid-template-columns: 150px repeat(4, minmax(200px, 1fr));
    /* 5 columns: Phase label + 4 Modules */
    gap: 16px;
    min-width: 1000px;
}

.matrix-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    text-align: center;
    padding: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-left: 2px solid var(--color-primary);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-cell {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.matrix-cell-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.hermes-result-pill {
    font-size: 0.8rem;
    padding: 6px 10px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-radius: 6px;
    cursor: help;
    transition: all 0.2s;
}

.hermes-result-pill:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Generation Process Screen */
.console-log {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    padding: 24px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    /* Monospace for tech feel */
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.log-entry {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

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

.log-entry.active {
    color: var(--color-primary);
    font-weight: 600;
}

.log-entry.success {
    color: #34d399;
}

.log-entry.waiting {
    color: rgba(255, 255, 255, 0.2);
}

.success-card {
    text-align: center;
    padding: 48px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 24px;
    box-shadow: 0 0 50px rgba(52, 211, 153, 0.2);
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}