/**
 * Portal App - Custom CSS with Glassmorphism
 */

:root {
  /* Color Palette (White & Light Blue) */
  --color-bg: #f4f9ff; /* Very soft light blue/gray for ambient background */
  --color-primary: #4ab4ff; /* Main Light Blue Accent */
  --color-primary-hover: #3a9dec;
  --color-text: #2c3e50; /* Soft dark slate for readability */
  --color-text-muted: #7f8c8d;
  --color-white: #ffffff;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-blur: blur(12px);

  /* Layout Variables */
  --sidebar-width: 250px;
  --header-height: 70px;
  --border-radius: 16px;
  --transition-speed: 0.3s;
}

/* Dark Mode Overrides */
html.dark-mode body {
  --color-bg: #121826;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-white: #1e293b;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; /* Clean, modern font */
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at top left, var(--color-primary) 0%, transparent 20%),
                    radial-gradient(circle at bottom right, var(--color-primary) 0%, transparent 20%);
  color: var(--color-text);
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

html.dark-mode body {
  background-image: radial-gradient(circle at top left, rgba(74, 180, 255, 0.15), transparent 40%),
                    radial-gradient(circle at bottom right, rgba(74, 180, 255, 0.15), transparent 40%);
}

/* The actual 16:9 app container */
.wrapper, .login-wrapper {
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  position: relative;
  display: flex;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0,0,0,0.4);
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--glass-border);
}

html.dark-mode .wrapper, html.dark-mode .login-wrapper {
  box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.wrapper {
  flex-direction: row;
}

/* Ensure sidebar and main-content are positioned inside the wrapper correctly */
.sidebar {
  position: static !important;
  height: 100% !important;
  flex-shrink: 0;
}
.main-content {
  margin-left: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  flex-grow: 1;
}

/* Login Wrapper Specific (Centering forms) */
.login-wrapper {
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-speed) ease;
}

a:hover {
  color: var(--color-primary-hover);
}

/* Glass Container Utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(74, 180, 255, 0.3);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 180, 255, 0.4);
  color: var(--color-white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background-color: rgba(74, 180, 255, 0.1);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  color: var(--color-text);
  transition: all var(--transition-speed) ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

html.dark-mode .form-control {
  background: rgba(15, 23, 42, 0.6);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(74, 180, 255, 0.2);
}

html.dark-mode .form-control:focus {
  background: var(--glass-bg);
}

.error-message {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-align: center;
}

/* Custom Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-bg);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  transition: transform var(--transition-speed) ease;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-text);
  margin-bottom: 15px;
}

.modal-body {
  color: var(--color-text-muted);
  margin-bottom: 25px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}



