/**
 * VVP Vaktplan - Design System v5.0
 * Best-in-class UI/UX for Employee Scheduling
 * Inspired by: When I Work, Deputy, Humanity
 * 
 * Mobile-first, fully responsive, modern design
 */

/* ============================================
   EMOJI SUPPORT - Native emojis (no WordPress conversion)
   ============================================ */

/* Ensure WordPress emoji images display if they exist */
img.emoji,
img.wp-smiley {
  display: inline-block !important;
  height: 1em !important;
  width: 1em !important;
  margin: 0 0.07em !important;
  vertical-align: -0.1em !important;
  background: none !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ensure native emojis render with proper font */
body,
.vvp-modern-dashboard,
.vvp-topbar,
.vvp-stat-card,
.card,
button,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
}

/* Specific emoji styling */
.emoji,
[role="img"],
span[aria-label] {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif !important;
  font-style: normal !important;
  font-weight: normal !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Colors - Fresh green palette */
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --secondary: #14b8a6;
  --secondary-dark: #0d9488;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  
  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Status colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Semantic colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border-color: #e2e8f0;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
  
  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Layout */
  --topbar-height: 64px;
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --container-max: 1600px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */
.vvp-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

/* Adjust for WordPress admin bar */
body.admin-bar .vvp-topbar {
  top: 32px; /* WP admin bar height on desktop */
}

@media screen and (max-width: 782px) {
  body.admin-bar .vvp-topbar {
    top: 46px; /* WP admin bar height on mobile */
  }
}

.vvp-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.vvp-topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.vvp-topbar-logo-icon {
  font-size: 2rem;
}

.vvp-topbar-nav {
  display: flex;
  gap: var(--space-2);
}

.vvp-topbar-nav-item {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.vvp-topbar-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.vvp-topbar-nav-item.active {
  background: var(--primary);
  color: white;
}

.vvp-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.vvp-topbar-search {
  position: relative;
  width: 300px;
}

.vvp-topbar-search input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.vvp-topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.vvp-topbar-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.vvp-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.vvp-topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-300);
  background: #ffffff;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 20px;
}

.vvp-topbar-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-900);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.vvp-topbar-btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  border: 2px solid #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Notifications Dropdown */
#vvp-notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: 500px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-base);
  z-index: 1000;
  overflow: hidden;
}

#vvp-notifications-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notifications-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.notifications-dropdown-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.notifications-dropdown-content {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-item:hover {
  background: var(--gray-50);
}

.notification-item.unread {
  background: #eff6ff;
}

.notification-item.unread:hover {
  background: #dbeafe;
}

.notification-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.notification-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.notification-unread-dot {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 8px;
  height: 8px;
  background: var(--info);
  border-radius: var(--radius-full);
}

.notifications-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  text-align: center;
}

.notifications-footer .btn-view-all {
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.notifications-footer .btn-view-all:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

@media (max-width: 768px) {
  #vvp-notifications-dropdown {
    width: calc(100vw - 32px);
    max-width: 400px;
    right: 16px;
  }
}

.vvp-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.vvp-topbar-user:hover {
  background: var(--bg-secondary);
}

.vvp-topbar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.vvp-topbar-user-info {
  display: flex;
  flex-direction: column;
}

.vvp-topbar-user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.vvp-topbar-user-role {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.vvp-topbar-user-arrow {
  font-size: 0.625rem;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
  margin-left: var(--space-1);
}

.vvp-topbar-user.active .vvp-topbar-user-arrow {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.vvp-user-dropdown,
.vvp-topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 1000;
}

.vvp-user-dropdown.active,
.vvp-topbar-user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.vvp-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.vvp-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.vvp-dropdown-icon {
  font-size: 1.125rem;
  opacity: 0.8;
}

.vvp-dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-2) 0;
}

/* Store dropdown in topbar */
.vvp-store-dropdown {
  padding: 8px 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vvp-store-dropdown:hover {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-dark);
}

.vvp-store-dropdown:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.vvp-layout {
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

/* Adjust for WordPress admin bar */
body.admin-bar .vvp-layout {
  padding-top: calc(var(--topbar-height) + 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .vvp-layout {
    padding-top: calc(var(--topbar-height) + 46px);
  }
}

.vvp-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* Full width variant */
.vvp-container-fluid {
  width: 100%;
  padding: var(--space-8) var(--space-6);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.vvp-page-header {
  margin-bottom: var(--space-8);
}

.vvp-page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.vvp-page-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.vvp-page-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ============================================
   CARDS & SECTIONS
   ============================================ */
.vvp-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: var(--space-6);
  transition: all var(--transition-base);
}

.vvp-card:hover {
  box-shadow: var(--shadow-md);
}

.vvp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-color);
}

.vvp-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.vvp-card-actions {
  display: flex;
  gap: var(--space-2);
}

.vvp-card-body {
  /* Body content */
}

.vvp-card-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================
   BUTTONS - Modern, consistent
   ============================================ */
.vvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.vvp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary button */
.vvp-btn-primary {
  background: var(--primary);
  color: white;
}

.vvp-btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Secondary button */
.vvp-btn-secondary {
  background: var(--secondary);
  color: white;
}

.vvp-btn-secondary:hover:not(:disabled) {
  background: var(--secondary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Outline button */
.vvp-btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.vvp-btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

/* Ghost button */
.vvp-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.vvp-btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Danger button */
.vvp-btn-danger {
  background: var(--error);
  color: white;
}

.vvp-btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Button sizes */
.vvp-btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
}

.vvp-btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

.vvp-btn-icon {
  padding: var(--space-3);
  width: 40px;
  height: 40px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --container-max: 100%;
  }
  
  .vvp-topbar-search {
    width: 200px;
  }
  
  .vvp-topbar-user-info {
    display: none;
  }
  
  .vvp-container {
    padding: var(--space-6) var(--space-4);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .vvp-topbar {
    padding: 0 var(--space-4);
  }
  
  .vvp-topbar-nav {
    display: none;
  }
  
  .vvp-topbar-search {
    display: none;
  }
  
  .vvp-page-title {
    font-size: 1.5rem;
  }
  
  .vvp-container {
    padding: var(--space-4) var(--space-3);
  }
  
  .vvp-card {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }
  
  .vvp-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.ml-4 { margin-left: var(--space-4); }
.mr-4 { margin-right: var(--space-4); }

