/* ========================================
   NXPortal Professional Theme System
   ======================================== */

/* CSS Variables for Theme System */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2a2a2a;
  --bg-card: #1e1e1e;
  --bg-input: #2a2a2a;
  --bg-hover: #3a3a3a;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --text-accent: #00d4ff;
  --text-success: #00ff88;
  --text-warning: #ffaa00;
  --text-error: #ff4444;
  --text-info: #4fc3f7;
  
  --border-primary: #333333;
  --border-secondary: #444444;
  --border-accent: #00d4ff;
  --border-focus: #00d4ff;
  
  --accent-primary: #00d4ff;
  --accent-secondary: #0099cc;
  --accent-success: #00ff88;
  --accent-warning: #ffaa00;
  --accent-error: #ff4444;
  --accent-info: #4fc3f7;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.6);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
  --transition-slow: 0.5s ease;
  
  /* Legacy variable mappings for existing code */
  --background-color: var(--bg-primary);
  --text-color: var(--text-primary);
  --card-background-color: var(--bg-card);
  --card-text-color: var(--text-primary);
  --button-color: var(--bg-tertiary);
  --button-hover-color: var(--bg-hover);
  --button-text-color: var(--text-primary);
  --input-background-color: var(--bg-input);
  --input-text-color: var(--text-primary);
  --input-border-color: var(--border-primary);
  --link-color: var(--accent-primary);
  --link-hover-color: var(--accent-secondary);
  --code-background-color: var(--bg-tertiary);
  --code-text-color: var(--text-primary);
  --pre-background-color: var(--bg-tertiary);
  --pre-text-color: var(--text-primary);
  --note-color: var(--text-muted);
  --warning-color: var(--accent-error);
  --header-background-color: var(--bg-secondary);
  --header-text-color: var(--text-primary);
  --border-color: var(--border-primary);
  --ck-button-color: var(--text-primary);
}

/* Light Theme */
.light-theme {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f1f3f4;
  --bg-overlay: rgba(255, 255, 255, 0.9);
  
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --text-accent: #0066cc;
  --text-success: #28a745;
  --text-warning: #ffc107;
  --text-error: #dc3545;
  --text-info: #17a2b8;
  
  --border-primary: #dee2e6;
  --border-secondary: #e9ecef;
  --border-accent: #0066cc;
  --border-focus: #0066cc;
  
  --accent-primary: #0066cc;
  --accent-secondary: #004499;
  --accent-success: #28a745;
  --accent-warning: #ffc107;
  --accent-error: #dc3545;
  --accent-info: #17a2b8;
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.25);
}

/* ========================================
   Base Styles
   ======================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   Theme Toggle System
   ======================================== */

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--border-primary);
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.2rem;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform var(--transition);
}

.theme-toggle:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

.theme-toggle i {
  position: relative;
  z-index: 2;
  transition: all var(--transition);
}

.theme-toggle:hover i {
  color: var(--bg-primary);
}

/* ========================================
   Header & Navigation
   ======================================== */

.header-body {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-body h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.home-button {
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  font-size: 1.1rem;
}

.home-button:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#page-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.main-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  transition: all var(--transition);
}

.main-content:hover {
  box-shadow: var(--shadow-lg);
}

.content-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.content-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.content-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ========================================
   Tool Cards & Grid System
   ======================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 2rem;
}

.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.tool-card:hover::before {
  left: 100%;
}

.tool-card:hover {
  background: var(--bg-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.tool-card i {
  font-size: 3rem;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  transition: all var(--transition);
}

.tool-card:hover i {
  transform: scale(1.1);
  color: var(--accent-secondary);
}

.tool-card h2 {
  font-size: 1.5rem;
  margin: 1rem 0;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

/* ========================================
   Form Styles
   ======================================== */

.form-container {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="color"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: var(--bg-card);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* ========================================
   Button Styles
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 2.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--transition);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--accent-warning);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #e0a800;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--accent-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #00e676;
  transform: translateY(-1px);
}

.btn-error {
  background: var(--accent-error);
  color: white;
}

.btn-error:hover:not(:disabled) {
  background: #e53935;
  transform: translateY(-1px);
}

/* ========================================
   Login & Auth Styles
   ======================================== */

.login-button-container {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.login-button {
  text-align: right;
  cursor: not-allowed;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  transition: all var(--transition);
  opacity: 0.6;
  font-weight: 500;
}

.auth-form {
  margin: 2rem auto;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 400px;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.5rem;
}

.auth-form input {
  margin-bottom: 1rem;
}

/* ========================================
   Training Bot Specific Styles
   ======================================== */

.training-body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

.main-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  margin-bottom: 2rem;
}

.what-to-do {
  margin-top: 2rem;
  text-align: center;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.wip {
  font-size: 1rem;
  color: var(--accent-warning);
  font-weight: 600;
  margin-bottom: 1rem;
}

.description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.training-container {
  margin: 2rem auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  min-height: 500px;
  max-width: 1000px;
  max-height: 750px;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.training-chat-container {
  overflow: auto;
  text-align: center;
  margin: 0 auto;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-tertiary);
}

.training-chat-container::-webkit-scrollbar {
  width: 6px;
}

.training-chat-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.training-chat-container::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
}

.training-input-form {
  display: flex;
  gap: 1rem;
  position: relative;
  bottom: 0;
  width: 90%;
  flex-direction: column;
  justify-content: flex-end;
  margin: 0 auto;
  margin-top: 2rem;
}

.training-section-title {
  cursor: pointer;
  margin-top: 1rem !important;
  font-weight: 600;
  margin: 0 auto;
  width: fit-content;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  border: 1px solid var(--border-primary);
}

.training-section-title:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pre-defined-option {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  transition: all var(--transition);
  margin-right: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
}

.pre-defined-option:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.skill-level-slider {
  -webkit-appearance: none;
  width: 50%;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  height: 8px;
  outline: none;
}

.skill-level-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.skill-level-slider::-webkit-slider-thumb:hover {
  background: var(--accent-secondary);
  transform: scale(1.1);
}

.skill-level-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  box-shadow: var(--shadow-sm);
}

.bot-message {
  text-align: left;
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.user-message {
  text-align: right;
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   Adventure Game Styles
   ======================================== */

.adventure-body {
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
  font-family: inherit;
  max-width: 90%;
  margin: 0 auto;
}

.adventure-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.adventure-overview {
  display: none;
  margin-top: 2rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.adventure-overview h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.adventure-content {
  margin-top: 2rem;
  max-height: 600px;
  border: 1px solid var(--border-primary);
  padding: 2rem;
  overflow: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.adventure-content::-webkit-scrollbar {
  width: 6px;
}

.adventure-content::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.adventure-content::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
}

.adventure-input {
  display: flex;
  justify-content: center;
  position: relative;
  bottom: 20px;
  width: 90%;
  margin: 0 auto;
  margin-top: 2rem;
}

.adventure-input input {
  width: 75%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition);
}

.adventure-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.adventure-option {
  margin-right: 10px;
  margin-bottom: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  transition: all var(--transition);
  font-size: 0.9rem;
}

.adventure-option:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   CV Generator Styles
   ======================================== */

.cv-form {
  max-width: 800px;
  margin: 0 auto;
}

/* Input Mode Toggle */
.input-mode-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-primary);
}

.toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-weight: 500;
}

.toggle-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.toggle-option.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Form Sections */
.form-section {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.form-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-primary);
}

.form-section h3 i {
  color: var(--accent-primary);
  font-size: 1.1rem;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.required {
  color: var(--accent-error);
  font-weight: 700;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background: var(--bg-card);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Color Picker */
.color-picker-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.color-picker-wrapper input[type="color"] {
  width: 50px;
  height: 50px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-preview {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-primary);
  background: var(--accent-primary);
}

.color-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex: 1;
}

/* Form Actions */
.form-actions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-primary);
  text-align: center;
}

.form-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-hint kbd {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-primary);
  font-family: 'Courier New', monospace;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

/* Loading Overlays */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-content {
  text-align: center;
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xl);
  max-width: 400px;
  width: 90%;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-primary);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-content h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.loading-content p {
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .input-mode-toggle {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .toggle-option {
    padding: 0.75rem;
  }
  
  .form-section {
    padding: 1.5rem;
  }
  
  .color-picker-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-large {
    width: 100%;
  }
  
  .loading-content {
    padding: 2rem;
    margin: 1rem;
  }
}

.title {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 2rem;
}

.title h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.title p {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.title span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.info-message {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.info-text {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.info-note {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  display: block;
  margin-top: 1rem;
}

.note-highlight {
  color: var(--accent-info) !important;
  font-weight: 600;
}

.note-warning {
  color: var(--accent-warning) !important;
  font-weight: 600;
}

#cvForm {
  max-width: 800px;
  margin: 0 auto;
  margin-bottom: 2rem;
}

#fields {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.switch-label {
  font-weight: 500;
  color: var(--text-primary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-tertiary);
  transition: var(--transition);
  border: 1px solid var(--border-primary);
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background: var(--text-primary);
  transition: var(--transition);
}

input:checked + .slider {
  background: var(--accent-primary);
}

input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

#cv {
  border: 1px solid var(--border-primary);
  padding: 2rem;
  margin-top: 2rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}

/* ========================================
   Loading & Modal Styles
   ======================================== */

.loading {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2rem;
  text-align: center;
  z-index: 1000;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
}

.loading img {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
}

.loading p {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.downloading {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2rem;
  text-align: center;
  z-index: 1000;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-primary);
}

/* ========================================
   Alert & Notification Styles
   ======================================== */

.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.alert-success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--text-success);
  border-color: var(--accent-success);
}

.alert-error {
  background: rgba(255, 68, 68, 0.1);
  color: var(--text-error);
  border-color: var(--accent-error);
}

.alert-warning {
  background: rgba(255, 170, 0, 0.1);
  color: var(--text-warning);
  border-color: var(--accent-warning);
}

.alert-info {
  background: rgba(79, 195, 247, 0.1);
  color: var(--text-info);
  border-color: var(--accent-info);
}

/* ========================================
   Code & Pre Styles
   ======================================== */

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  overflow-x: auto;
  font-family: 'Courier New', monospace;
}

code {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* ========================================
   Links & Typography
   ======================================== */

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

ul, ol {
  padding-left: 2rem;
  color: var(--text-primary);
}

li {
  margin-bottom: 0.5rem;
}

/* ========================================
   Table Styles
   ======================================== */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-primary);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
}

td {
  color: var(--text-secondary);
}

tr:hover {
  background: var(--bg-hover);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
    margin: 1rem auto;
  }
  
  .header-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .tool-card {
    padding: 1.5rem;
  }
  
  .tool-card i {
    font-size: 2.5rem;
  }
  
  .content-header {
    padding: 1.5rem 1.5rem 1rem;
  }
  
  .content-header h2 {
    font-size: 1.5rem;
  }
  
  .form-container {
    padding: 1.5rem;
  }
  
  .training-container {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
  }
  
  .adventure-input {
    flex-direction: column;
    gap: 1rem;
  }
  
  .adventure-input input {
    width: 100%;
  }
  
  .adventure-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .toggle-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .formHint {
    display: none;
  }
  
  .btn {
    width: 100%;
  }
  
  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    margin: 0.5rem auto;
  }
  
  .content-header h2 {
    font-size: 1.3rem;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 0.6rem 0.8rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .tool-card {
    padding: 1rem;
  }
  
  .tool-card h2 {
    font-size: 1.2rem;
  }
  
  .tool-card i {
    font-size: 2rem;
  }
}

/* ========================================
   Animation & Transition Classes
   ======================================== */

.change-mode {
  transition: all 0.5s ease !important;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden { display: none; }
.visible { display: block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .header-body,
  .theme-toggle,
  .btn,
  .adventure-input,
  .training-input-form {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .main-content,
  .tool-card,
  .adventure-content {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
