/* SmartVisitor Admin - Common Styles */
/* Gedeelde CSS voor alle pagina's */
/* Build: 2026-01-07-v1 */

/* ============================================
   CUSTOM SCROLLBARS
   ============================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0e1330;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
  border: 2px solid #0e1330;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

::-webkit-scrollbar-thumb:active {
  background: #60a5fa;
}

::-webkit-scrollbar-corner {
  background: #0e1330;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0e1330;
}

/* Sidebar specific scrollbar (slightly thinner) */
.nav-sidebar::-webkit-scrollbar {
  width: 6px;
}

.nav-sidebar::-webkit-scrollbar-thumb {
  background: #222741;
  border: 1px solid #0e1330;
}

.nav-sidebar::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Table containers scrollbar */
.table-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.panel-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Code/pre blocks scrollbar */
pre::-webkit-scrollbar,
code::-webkit-scrollbar,
.code-block::-webkit-scrollbar {
  height: 6px;
}

pre::-webkit-scrollbar-thumb,
code::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb {
  background: #475569;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

#breadcrumbs {
  padding: 8px 16px;
  background: #0e1330;
  border-bottom: 1px solid #222741;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #9aa4b2;
  margin: 0 4px;
}

.breadcrumb-current {
  color: #e9eef7;
  font-weight: 600;
}

/* ============================================
   TERUG KNOP
   ============================================ */

#btnBack {
  display: none;
  margin-right: 8px;
}

#btnBack::before {
  content: '←';
  margin-right: 4px;
}

/* ============================================
   TOOLTIPS
   ============================================ */

.tooltip {
  animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Tooltip arrow */
.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1e293b;
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #151a2c;
  border: 1px solid #222741;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */

#btnGlobalSearch {
  position: relative;
}

#btnGlobalSearch::after {
  content: '⌘K';
  margin-left: 8px;
  font-size: 10px;
  opacity: 0.6;
  font-weight: normal;
}

/* Voor Windows gebruikers */
@media (platform: windows) {
  #btnGlobalSearch::after {
    content: 'Ctrl+K';
  }
}

/* Search results styling */
#searchResults a {
  transition: background 0.2s;
}

#searchResults a:hover {
  background: #1e293b;
}

/* Search accordion styling */
.search-accordion {
  overflow: hidden;
}

.search-accordion-header {
  user-select: none;
}

.search-accordion-content {
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Hover effects voor klikbare items */
.clickable {
  cursor: pointer;
  transition: background 0.2s;
}

.clickable:hover {
  background: #1e293b;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #9aa4b2;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide in animation */
.slide-in {
  animation: slideIn 0.3s ease-out;
}

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

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
  #breadcrumbs {
    font-size: 11px;
    padding: 6px 12px;
  }
  
  .breadcrumb-separator {
    margin: 0 2px;
  }
  
  #btnGlobalSearch::after {
    display: none;
  }
}

/* ============================================
   FORM ELEMENTS - GLOBAL STYLING
   ============================================ */

/* Remove browser default appearance for select dropdowns */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa4b2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Ensure select has proper cursor */
select {
  cursor: pointer;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus styles */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #2a49ff;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  #breadcrumbs,
  #btnBack,
  #btnGlobalSearch,
  button,
  .modal {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* ============================================
   ENHANCED TABLE STYLES
   ============================================ */

/* Hover effect op table rows */
tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(96, 165, 250, 0.05);
}

/* Sticky table headers */
.sticky-header thead {
  position: sticky;
  top: 0;
  background: #151a2c;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-indicator.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-indicator.offline {
  background: #6b7280;
}

.status-indicator.warning {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.status-indicator.error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Pulsing animation voor live status */
.status-indicator.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #e9eef7;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #334155;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2000;
  animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.success {
  border-color: #22c55e;
  background: #1e3a2c;
}

.toast.error {
  border-color: #ef4444;
  background: #3a1e1e;
}

.toast.warning {
  border-color: #f59e0b;
  background: #3a2e1e;
}

/* ============================================
   CONTEXT MENU (right-click)
   ============================================ */

.context-menu {
  position: fixed;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 3000;
  min-width: 150px;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}

.context-menu-item:hover {
  background: #334155;
}

.context-menu-separator {
  height: 1px;
  background: #334155;
  margin: 4px 0;
}

/* ============================================
   FLOATING ACTION BUTTON (FAB)
   ============================================ */

.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(96, 165, 250, 0.5);
}

.fab-button:active {
  transform: scale(0.95);
}

.fab-icon {
  font-size: 28px;
  font-weight: 300;
  color: #fff;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-button.active .fab-icon {
  transform: rotate(45deg);
}

.fab-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-actions.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.fab-action {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 28px;
  padding: 10px 20px 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  min-height: 44px;
}

.fab-action:hover {
  background: #334155;
  border-color: #475569;
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.fab-action-icon {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-action-label {
  font-size: 14px;
  font-weight: 500;
  color: #e9eef7;
}

/* Hide FAB on login page */
body.login-page .fab-container {
  display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .fab-container {
    bottom: 16px;
    right: 16px;
  }

  .fab-button {
    width: 48px;
    height: 48px;
  }

  .fab-icon {
    font-size: 24px;
  }

  .fab-action {
    padding: 8px 16px 8px 10px;
    min-height: 40px;
  }

  .fab-action-icon {
    font-size: 18px;
    width: 20px;
    height: 20px;
  }

  .fab-action-label {
    font-size: 13px;
  }
}

