:root {
  --bg-color: #0d0d0d;
  --card-bg: #111111;
  --border-color: rgba(0, 255, 204, 0.3);
  --text-color: #e0e0e0;
  --header-color: #00ffcc;
  --accent-red: #ff1744;
  --glow-color: rgba(0, 255, 204, 0.2);
  --glow-color-red: rgba(255, 23, 68, 0.4);
  --font-family: 'Courier New', monospace;
  --status-active: #00ffcc;
  --status-training: #ffcc00;
  --status-idle: #8b949e;
  --status-operational: var(--status-active);
  --status-learning: var(--status-training);
  --status-scanning: #33a3ff;
  --status-producing: #ff47a6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.5;
}

#root, #app-container {
  min-height: 100vh;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes flicker {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color);
  }
  50% {
    opacity: 0.8;
    text-shadow: 0 0 8px var(--glow-color), 0 0 15px var(--glow-color);
  }
}

@keyframes flicker-red {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 10px var(--glow-color-red), 0 0 20px var(--glow-color-red);
  }
  50% {
    opacity: 0.8;
    text-shadow: 0 0 8px var(--glow-color-red), 0 0 15px var(--glow-color-red);
  }
}


.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.5rem;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

h1, h2, h3 {
  color: var(--header-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

p.section-description, .api-principle, .endpoint-description {
    color: #8b949e;
    margin-bottom: 1.5rem;
}

/* --- Login & Loading --- */
.login-container, .loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card { max-width: 450px; }
.login-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1.5rem; }

.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { text-transform: uppercase; font-size: 0.8rem; font-weight: 700; }
.input-group input { background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 4px; padding: 0.75rem; color: var(--text-color); font-family: var(--font-family); font-size: 1rem; }
.input-group input:focus { outline: none; border-color: var(--header-color); box-shadow: 0 0 5px var(--glow-color); }

.login-button { background-color: var(--header-color); color: var(--bg-color); border: none; border-radius: 6px; padding: 0.75rem 1.5rem; font-family: var(--font-family); font-weight: 700; text-transform: uppercase; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.login-button:hover:not(:disabled) { background-color: #ffffff; }
.login-button:disabled { background-color: var(--border-color); color: #8b949e; cursor: not-allowed; }

.error-message { color: var(--accent-red); text-align: center; font-weight: 700; }

.access-granted-message {
  color: var(--status-active);
  font-size: 1.75rem;
  text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color);
  animation: fadeIn 0.5s ease-out, flicker 2s infinite alternate;
}

.access-denied-message {
  color: var(--accent-red);
  font-size: 1.75rem;
  text-shadow: 0 0 10px var(--glow-color-red), 0 0 20px var(--glow-color-red);
  animation: fadeIn 0.5s ease-out, flicker-red 2s infinite alternate;
}

.loading-container h1 { font-size: 1.75rem; }
.loading-progress-bar-container { width: 100%; max-width: 500px; background-color: #010409; border: 1px solid var(--border-color); border-radius: 4px; padding: 4px; margin: 2rem 0; }
.loading-container .progress-bar-inner { background-color: var(--header-color); color: var(--bg-color); }
.status-message { font-size: 1rem; color: var(--text-color); }

/* --- Dashboard Layout --- */
.dashboard-container { display: flex; flex-direction: column; gap: 1.5rem; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.5rem; }
.dashboard-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.5rem; }
.dashboard-header .header-main { flex-grow: 1; }
.dashboard-header h1 { margin: 0; font-size: 1.75rem; }
.dashboard-header p { margin: 0.25rem 0 0; color: #8b949e; }
.header-meta { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.logout-button { background: none; border: 1px solid var(--accent-red); color: var(--accent-red); padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; font-family: var(--font-family); font-weight: 700; text-transform: uppercase; transition: background-color 0.2s, color 0.2s; }
.logout-button:hover { background-color: var(--accent-red); color: var(--bg-color); }

/* --- Tabs --- */
.tabs-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: -1px; }
.tab-button { background: none; border: 1px solid transparent; border-bottom: none; color: #8b949e; padding: 0.75rem 1.5rem; font-family: var(--font-family); font-size: 1rem; cursor: pointer; transition: color 0.2s, border-color 0.2s; border-radius: 6px 6px 0 0; }
.tab-button.active { color: var(--header-color); border-color: var(--border-color); background-color: var(--card-bg); border-bottom: 1px solid var(--card-bg); }
.tab-button:hover:not(.active) { color: var(--text-color); }

/* --- Content Panels --- */
.content-grid { display: grid; gap: 1.5rem; }
.agents-params-layout { grid-template-columns: 2fr 1fr; }
.command-layout { grid-template-columns: 1fr 1fr; }
@media (max-width: 1024px) {
    .agents-params-layout, .command-layout { grid-template-columns: 1fr; }
}

/* --- Status Colors --- */
.status-active, .status-operational { color: var(--status-active); }
.status-training, .status-learning { color: var(--status-training); }
.status-idle { color: var(--status-idle); }
.status-scanning { color: var(--status-scanning); }
.status-producing { color: var(--status-producing); }

/* --- Architecture --- */
.architecture-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.layer-card h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.layer-card h3 span { text-transform: capitalize; }
.layer-card p { color: #8b949e; margin-bottom: 1rem; min-height: 40px; }
.capabilities { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.capability-tag { background-color: var(--bg-color); border: 1px solid var(--border-color); padding: 0.25rem 0.75rem; border-radius: 4px; font-size: 0.8rem; }

/* --- Agents Table --- */
.agents-table { width: 100%; border-collapse: collapse; }
.agents-table th, .agents-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.agents-table th { color: var(--header-color); text-transform: uppercase; font-size: 0.8rem; }
.agents-table td span { text-transform: capitalize; }

/* --- Progress Bar --- */
.progress-bar { width: 100%; background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden; font-size: 0.8rem; }
.progress-bar-inner { background-color: var(--header-color); color: var(--bg-color); height: 100%; padding: 4px 8px; text-align: right; font-weight: bold; white-space: nowrap; transition: width 1s ease-in-out; }

/* --- System Stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.stat-item { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-item-label { font-weight: bold; color: var(--header-color); }
.stat-item-value { font-size: 1.5rem; font-weight: bold; }
.security-level .stat-item-value { color: var(--status-active); }

/* --- Operational Parameters --- */
.params-list { list-style: none; }
.param-item { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.param-item:last-child { border-bottom: none; }
.param-name { font-weight: bold; }
.param-value-true { color: var(--status-active); font-weight: bold; }
.param-value-false { color: var(--accent-red); font-weight: bold; }

/* --- API Protocol --- */
.endpoint-card { margin-bottom: 1.5rem; background-color: var(--bg-color); }
.endpoint-card h3 { display: flex; align-items: center; gap: 0.75rem; font-size: 1.1rem; }
.method-tag { padding: 0.25rem 0.75rem; border-radius: 4px; color: var(--bg-color); font-weight: bold; }
.method-post { background-color: #49cc90; }
.params-table { width: 100%; margin: 1rem 0; font-size: 0.9rem; }
.params-table th, .params-table td { padding: 0.5rem; border: 1px solid var(--border-color); }
.constraint-text { background-color: rgba(255, 199, 0, 0.1); border-left: 3px solid var(--status-training); padding: 0.75rem; margin: 1rem 0; }
.response-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
pre { background-color: #010409; padding: 1rem; border-radius: 4px; border: 1px solid var(--border-color); overflow-x: auto; font-size: 0.85rem; }
@media (max-width: 768px) { .response-container { grid-template-columns: 1fr; } }

/* --- Command Interface --- */
.command-form { display: flex; gap: 1rem; align-items: center; }
.input-wrapper { flex-grow: 1; display: flex; align-items: center; background-color: var(--bg-color); border: 1px solid var(--border-color); border-radius: 6px; padding: 0 0.75rem; }
.input-wrapper:focus-within { border-color: var(--header-color); box-shadow: 0 0 5px var(--glow-color); }
.prompt-symbol { color: var(--header-color); margin-right: 0.5rem; font-weight: 700; }
.command-input { width: 100%; background: none; border: none; color: var(--text-color); font-family: var(--font-family); font-size: 1rem; padding: 0.75rem 0; outline: none; }
.command-input::placeholder { color: #8b949e; opacity: 0.6; }
.command-submit { background-color: var(--header-color); color: var(--bg-color); border: none; border-radius: 6px; padding: 0.75rem 1.5rem; font-family: var(--font-family); font-weight: 700; text-transform: uppercase; cursor: pointer; transition: background-color 0.2s; }
.command-submit:disabled { background-color: var(--border-color); color: #8b949e; cursor: not-allowed; }
.command-output-card .output-container { background-color: #010409; min-height: 150px; padding: 1rem; border-radius: 6px; border: 1px solid var(--border-color); font-size: 0.9rem; max-height: 400px; overflow-y: auto; }
.loading-indicator { color: var(--header-color); opacity: 0.8; font-weight: 700; text-align: center; }

/* --- Movies Gallery & Generation --- */
.movies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.video-card { background-color: var(--card-bg); border-radius: 6px; overflow: hidden; cursor: pointer; position: relative; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid transparent; display: flex; flex-direction: column; }
.video-card:hover { transform: translateY(-5px); box-shadow: 0 0 15px var(--glow-color); border-color: var(--border-color); }
.video-thumbnail-container { position: relative; width: 100%; padding-top: 56.25%; /* 16:9 Aspect Ratio */ }
.video-thumbnail { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.2s; display: flex; justify-content: center; align-items: center; }
.video-card:hover .video-card-overlay { opacity: 1; }
.play-icon { width: 50px; height: 50px; background-color: var(--header-color); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.video-card-content { padding: 1rem; flex-grow: 1; }
.video-title { font-size: 1rem; margin: 0; color: var(--text-color); }
.video-author { font-size: 0.8rem; color: #8b949e; margin-top: 0.25rem; }

.video-delete-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background-color: rgba(13, 13, 13, 0.7);
  color: var(--accent-red);
  border: 1px solid var(--accent-red);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  line-height: 26px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s, background-color 0.2s;
}

.video-card:hover .video-delete-button {
  opacity: 1;
  transform: scale(1);
}

.video-delete-button:hover {
  background-color: var(--accent-red);
  color: var(--bg-color);
}


/* Video Generation Form */
.video-generation-form form { display: flex; flex-direction: column; gap: 1rem; }
.prompt-textarea { width: 100%; min-height: 80px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 4px; padding: 0.75rem; color: var(--text-color); font-family: var(--font-family); font-size: 1rem; resize: vertical; }
.prompt-textarea:focus { outline: none; border-color: var(--header-color); box-shadow: 0 0 5px var(--glow-color); }
.prompt-textarea:disabled { background-color: #1a1a1a; cursor: not-allowed; }

/* Video Generation Overlay */
.video-generation-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; display: flex; justify-content: center; align-items: center; animation: fadeIn 0.3s; }
.video-generation-overlay .spinner { width: 60px; height: 60px; border: 5px solid var(--border-color); border-top-color: var(--header-color); border-radius: 50%; animation: spin 1s linear infinite; }
.video-generation-overlay .loading-container { gap: 1.5rem; }


/* --- Video Player Modal --- */
.video-player-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 1000; display: flex; justify-content: center; align-items: center; animation: fadeIn 0.3s; }
.video-player-modal-content { background: var(--card-bg); width: 90%; max-width: 960px; max-height: 90vh; border-radius: 6px; border: 1px solid var(--border-color); display: flex; flex-direction: column; position: relative; }
.video-player-close-button { position: absolute; top: -15px; right: -15px; background: var(--header-color); color: var(--bg-color); border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 1.5rem; line-height: 30px; text-align: center; cursor: pointer; z-index: 1001; }
.video-player-video { width: 100%; max-height: 70vh; }
.video-player-info { padding: 1.5rem; overflow-y: auto; }
.video-player-title { margin-bottom: 0.5rem; }
.video-player-author { font-size: 0.9rem; color: var(--header-color); margin-bottom: 1rem; font-style: italic; }
.video-player-description { color: #8b949e; }

/* --- System Lockdown --- */
.system-lockdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  padding: 2rem;
}

.system-lockdown-overlay h1 {
  font-size: 2rem;
}

.system-lockdown-overlay p {
  margin-top: 1rem;
  color: var(--text-color);
  font-size: 1rem;
}
