:root {
  --bg-dark: #0a0e17;
  --bg-panel: rgba(20, 26, 40, 0.4);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text-main: #f0f4f8;
  --text-muted: #8b9bb4;
  --accent-color: #00d2ff;
  --accent-glow: rgba(0, 210, 255, 0.3);
  --danger-color: #ff4b4b;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Effects */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  animation: pulse-glow 8s infinite alternate;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-glow);
  top: -100px;
  left: -100px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: rgba(80, 50, 255, 0.2);
  bottom: -200px;
  right: -100px;
  animation-delay: 2s;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.1); opacity: 0.6; }
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Common Components */
.hidden {
  display: none !important;
}

.btn-primary {
  background: var(--accent-color);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  background: #33dbff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(10, 14, 23, 0.6);
  backdrop-filter: blur(10px);
  transition: opacity 0.5s ease;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  text-align: center;
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.login-overlay.fade-out .login-card {
  transform: translateY(-20px);
}

.login-header {
  margin-bottom: 30px;
}

.icon-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.1);
  color: var(--accent-color);
  margin-bottom: 16px;
  border: 1px solid var(--accent-glow);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 15px rgba(0, 210, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 210, 255, 0); }
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-group {
  margin-bottom: 24px;
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.error-msg {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 8px;
  display: none;
  text-align: left;
}

.login-card form {
  display: flex;
  flex-direction: column;
}

/* Portal Layout */
.portal-container {
  display: flex;
  height: 100vh;
  padding: 24px;
  gap: 24px;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.portal-container.visible {
  opacity: 1;
  transform: scale(1);
}

.sidebar {
  width: 280px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 40px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-links li {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.nav-links li:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-links li.active {
  background: rgba(0, 210, 255, 0.1);
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
}

.top-bar h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.content-sections {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

section {
  display: none;
  animation: fade-in 0.4s ease;
}

section.active-section {
  display: block;
}

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

.welcome-card {
  padding: 40px;
  background: linear-gradient(135deg, rgba(20,26,40,0.6) 0%, rgba(0,210,255,0.05) 100%);
}

.welcome-card h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.welcome-card p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Grid & Cards */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--accent-color);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 210, 255, 0.1);
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Image Cards (Patient Education) */
.image-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.image-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 210, 255, 0.1);
}

.image-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-glass);
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-content h3 {
  font-size: 1.1rem;
  color: var(--text-main);
}

.card-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Link Cards */
.link-card {
  text-decoration: none;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.highlight-card {
  background: linear-gradient(135deg, rgba(20,26,40,0.6) 0%, rgba(255, 75, 75, 0.05) 100%);
  border-color: rgba(255, 75, 75, 0.2);
}

.highlight-card:hover {
  border-color: rgba(255, 75, 75, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 75, 75, 0.15);
}

.social-card {
  background: linear-gradient(135deg, rgba(20,26,40,0.6) 0%, rgba(29, 161, 242, 0.05) 100%);
}

/* Full Height Section for iframe */
section.active-section.full-height-section {
  display: flex;
}

.full-height-section {
  flex-direction: column;
  height: 100%;
  min-height: 80vh;
}

.ivus-iframe {
  width: 100%;
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  background: #fff; /* Wit achtergrond voor als de app dit verwacht */
}

/* PDF Reader Overlay */
.reader-container {
  width: 90%;
  height: 90%;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Book Card */
.book-card {
  min-height: 180px;
  justify-content: flex-start;
  transition: var(--transition);
}

.book-card:hover {
  background: linear-gradient(135deg, rgba(20,26,40,0.8) 0%, rgba(0,210,255,0.15) 100%);
  border-color: var(--accent-color);
}

/* Filter Selects */
.filter-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(20,26,40,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
}

.filter-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0,210,255,0.2);
}

.filter-select option {
  background: var(--bg-dark);
  color: #fff;
}

/* Login Screen */
.login-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 400px;
  padding: 40px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.login-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.login-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 210, 255, 0.2);
}
