/* ==========================================
   DEKAT - Modern UI/UX Pro Max CSS System
   Target: Ultra accessible, responsive, sleek dark glassmorphism
   Role Landing Chooser + Dedicated Role Views
   ========================================== */

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-height: 60px;
}

html[data-theme="light"] {
  --bg-dark: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-border: rgba(0, 0, 0, 0.12);
  --text-main: #0f172a;
  --text-muted: #475569;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .brand-name {
  background: linear-gradient(135deg, #0f172a 30%, #1e40af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .role-chooser-overlay {
  background: rgba(241, 245, 249, 0.98);
}

html[data-theme="light"] .role-chooser-container {
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .role-select-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .role-card-content h3 {
  color: #0f172a;
}

html[data-theme="light"] .modal-content {
  background: #ffffff;
  color: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  flex-shrink: 0;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-radius: var(--radius-full);
  border: 1px solid rgba(96, 165, 250, 0.3);
  font-weight: 600;
}

/* Role Chooser Landing Screen Overlay */
.role-chooser-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(24px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.role-chooser-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.role-chooser-container {
  width: 100%;
  max-width: 480px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.role-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.role-select-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.role-select-card:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.role-card-icon {
  font-size: 36px;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.role-card-content {
  flex: 1;
  min-width: 0;
}

.role-card-content h3 {
  font-size: 16px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.role-card-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.role-card-arrow {
  font-size: 20px;
  color: #38bdf8;
  font-weight: 800;
}

/* App Main Body Container */
.app-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

/* Glassmorphism Card Utilities */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Buttons & Inputs */
.btn {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 14px var(--danger-glow);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--bg-card-border);
  color: white;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modals & Popups */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

/* Badge tags */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
