@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #0a0c10;
    --bg-card: rgba(18, 22, 30, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-active: rgba(0, 242, 254, 0.4);
    
    --neon-cyan: #00f2fe;
    --neon-green: #00f5a0;
    --neon-orange: #ff9f43;
    --neon-red: #ff4d4d;
    --text-primary: #f5f6fa;
    --text-secondary: #a0aec0;
    
    --shadow-cyan: 0 0 15px rgba(0, 242, 254, 0.2);
    --shadow-red: 0 0 15px rgba(255, 77, 77, 0.3);
    --shadow-green: 0 0 15px rgba(0, 245, 160, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(at 10% 20%, rgba(0, 242, 254, 0.03) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(255, 77, 77, 0.03) 0px, transparent 50%);
}

/* Header */
header {
    height: 60px;
    background: rgba(10, 12, 16, 0.9);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.logo-section h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-section h1 span {
    color: var(--neon-cyan);
    text-shadow: var(--shadow-cyan);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neon-green);
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
    animation: pulse 2s infinite;
}

.live-timer {
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

/* Main Layout */
.app-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Card Base */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(16px) saturate(120%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}

.glass-card.card-warning::before {
    background: var(--neon-orange);
}

.glass-card.card-danger::before {
    background: var(--neon-red);
}

.glass-card.card-success::before {
    background: var(--neon-green);
}

.card-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-cyan { background: rgba(0, 242, 254, 0.1); color: var(--neon-cyan); border: 1px solid rgba(0, 242, 254, 0.2); }
.badge-green { background: rgba(0, 245, 160, 0.1); color: var(--neon-green); border: 1px solid rgba(0, 245, 160, 0.2); }
.badge-orange { background: rgba(255, 159, 67, 0.1); color: var(--neon-orange); border: 1px solid rgba(255, 159, 67, 0.2); }
.badge-red { background: rgba(255, 77, 77, 0.1); color: var(--neon-red); border: 1px solid rgba(255, 77, 77, 0.2); }

/* Left Workspace */
.workspace-column {
    display: grid;
    grid-template-rows: 1.1fr 0.9fr;
    gap: 16px;
    height: 100%;
}

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

/* Görev 1: Kodlama */
.code-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.task-instruction {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.task-instruction code {
    font-family: 'Fira Code', monospace;
    color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
}

.editor-container {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: #0d1117;
    position: relative;
    display: flex;
    overflow: hidden;
}

.editor-line-numbers {
    width: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 0;
    text-align: right;
    padding-right: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.2);
    line-height: 1.6;
}

.editor-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e6edf3;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    padding: 12px;
    resize: none;
    line-height: 1.6;
    user-select: text;
}

.editor-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding-top: 4px;
}

.editor-stats span strong {
    color: var(--text-primary);
}

/* Görev 2: Bilet Desteği */
.ticket-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.ticket-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    overflow-y: auto;
}

.ticket-sender {
    font-weight: 600;
    color: var(--neon-cyan);
    margin-bottom: 6px;
    font-size: 12px;
}

.ticket-message {
    color: var(--text-primary);
    font-style: italic;
}

.ticket-options {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    background: rgba(0, 242, 254, 0.05);
    border-color: var(--border-active);
    box-shadow: var(--shadow-cyan);
    transform: translateY(-1px);
}

.option-btn:active {
    transform: translateY(0);
}

/* Görev 3: Doğrulama Testi */
.attention-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.attention-idle-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.attention-idle-state i {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--neon-cyan);
    animation: float 3s ease-in-out infinite;
}

.attention-alert-box {
    display: none;
    position: fixed;
    z-index: 9999;
    width: 280px;
    height: 140px;
    background: rgba(18, 22, 30, 0.95);
    border: 2px solid var(--neon-red);
    border-radius: 12px;
    box-shadow: var(--shadow-red), inset 0 0 15px rgba(255, 77, 77, 0.1);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    animation: flashBorder 1s infinite alternate;
}

.attention-title {
    color: var(--neon-red);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
}

.attention-timer-bar {
    width: 80%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.attention-timer-progress {
    width: 100%;
    height: 100%;
    background: var(--neon-red);
    transform-origin: left;
    animation: drainTime 3s linear forwards;
}

.attention-btn {
    background: var(--neon-red);
    border: none;
    color: white;
    padding: 10px 24px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: var(--shadow-red);
    transition: transform 0.1s ease;
}

.attention-btn:hover {
    transform: scale(1.05);
}

.attention-btn:active {
    transform: scale(0.95);
}

/* Right Dashboard Column */
.dashboard-column {
    display: grid;
    grid-template-rows: 1.1fr 1fr 0.6fr;
    gap: 16px;
    height: 100%;
}

/* Canlı Verimlilik Puanı */
.gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-1: 1;
}

.gauge-circle {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 12;
}

.gauge-progress {
    fill: none;
    stroke: var(--neon-green);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 452.4; /* 2 * PI * r (r=72) */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
    filter: drop-shadow(0 0 6px var(--neon-green));
}

.gauge-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gauge-value {
    font-size: 38px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    transition: color 0.5s ease;
}

.gauge-unit {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.score-stats {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.score-stat-item {
    text-align: center;
}

.score-stat-val {
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 14px;
}

.score-stat-val.plus { color: var(--neon-green); }
.score-stat-val.minus { color: var(--neon-red); }

.score-stat-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Telemetri Terminali */
.terminal-console {
    background: #07090d;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    line-height: 1.4;
    word-break: break-all;
    animation: slideInLog 0.2s ease-out forwards;
}

.log-entry.log-info { color: var(--neon-cyan); }
.log-entry.log-success { color: var(--neon-green); }
.log-entry.log-warn { color: var(--neon-orange); }
.log-entry.log-error { color: var(--neon-red); }

.log-time {
    color: rgba(255, 255, 255, 0.3);
    margin-right: 6px;
}

/* Odak İzleyicisi */
.focus-monitor {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.focus-status-card {
    background: rgba(0, 245, 160, 0.03);
    border: 1px solid rgba(0, 245, 160, 0.15);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.focus-status-card.lost {
    background: rgba(255, 77, 77, 0.05);
    border-color: rgba(255, 77, 77, 0.3);
    box-shadow: var(--shadow-red);
    animation: shake 0.3s ease-in-out;
}

.focus-label {
    font-size: 13px;
    font-weight: 600;
}

.focus-value {
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--neon-green);
    text-shadow: var(--shadow-green);
}

.focus-status-card.lost .focus-value {
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
}

.shift-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.action-btn.btn-danger {
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.3);
    color: var(--neon-red);
}

.action-btn.btn-danger:hover {
    background: var(--neon-red);
    color: white;
    box-shadow: var(--shadow-red);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

@keyframes flashBorder {
    from { border-color: rgba(255, 77, 77, 0.3); }
    to { border-color: var(--neon-red); }
}

@keyframes drainTime {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* Ending Screen Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 5, 8, 0.95);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: none; /* JS triggers display */
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px;
    overflow-y: auto;
}

/* Kovulma (Termination) */
.fired-screen {
    max-width: 500px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: shake 0.6s ease-in-out;
    margin: auto 0;
}

.fired-icon {
    font-size: 70px;
    color: var(--neon-red);
    text-shadow: var(--shadow-red);
    animation: pulse 1s infinite alternate;
}

.fired-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--neon-red);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.fired-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.proceed-btn {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.proceed-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: var(--shadow-cyan);
}

/* Rapor Ekranı */
.report-container {
    max-width: 850px;
    width: 100%;
    background: rgba(18, 22, 30, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    display: none; /* JS triggers flex */
    flex-direction: column;
    gap: 24px;
    animation: slideInLog 0.4s ease-out forwards;
}

.report-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.report-header h2 span {
    color: var(--neon-red);
}

.report-score-badge {
    text-align: right;
}

.report-score-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report-score-val {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Fira Code', monospace;
    color: var(--neon-cyan);
}

/* Infographic Grid */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.report-summary-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.summary-val {
    font-family: 'Fira Code', monospace;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.summary-val.neutral { color: var(--neon-cyan); }
.summary-val.negative { color: var(--neon-red); }

.summary-lbl {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Category Alert */
.category-alert {
    background: rgba(255, 77, 77, 0.04);
    border: 1px solid rgba(255, 77, 77, 0.2);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-alert.success {
    background: rgba(0, 245, 160, 0.04);
    border-color: rgba(0, 245, 160, 0.2);
}

.category-alert-title {
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-red);
}

.category-alert.success .category-alert-title {
    color: var(--neon-green);
}

.category-alert-desc {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Etik İhlal Kartları */
.violations-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.violations-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.violation-card {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
}

.violation-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.violation-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.violation-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.violation-badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: rgba(255, 77, 77, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.violation-impact {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.violation-right {
    font-size: 11.5px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid var(--neon-orange);
    padding: 10px 12px;
    color: var(--text-secondary);
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

/* Reflection / Footer */
.reflection-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reflection-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-cyan);
}

.reflection-questions {
    list-style: none;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.5;
}

.reflection-questions li {
    position: relative;
    padding-left: 20px;
}

.reflection-questions li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    font-weight: bold;
}

.restart-btn {
    align-self: center;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
    border: none;
    color: var(--bg-dark);
    padding: 14px 40px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.25);
    transition: all 0.2s ease;
    margin-top: 10px;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 242, 254, 0.35);
}

.restart-btn:active {
    transform: translateY(0);
}

/* Responsive / Overflow Fixes */
@media (max-width: 1200px), (max-height: 850px) {
    body {
        overflow-y: auto !important;
        height: auto !important;
    }
    
    .app-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        overflow: visible !important;
        min-height: calc(100vh - 60px);
        padding-bottom: 40px;
    }
    
    .workspace-column {
        height: auto !important;
        grid-template-rows: auto auto !important;
        gap: 16px;
    }
    
    .workspace-bottom {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 16px;
    }
    
    .dashboard-column {
        height: auto !important;
        grid-template-rows: auto auto auto !important;
        gap: 16px;
    }
    
    .glass-card {
        height: auto !important;
        min-height: 280px;
    }
    
    .code-editor-wrapper {
        min-height: 350px;
    }
    
    .editor-container {
        min-height: 200px;
    }
    
    .ticket-wrapper {
        min-height: 250px;
    }
}
