@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-dark: #030B1A;
  --bg-card: rgba(13, 27, 54, 0.6);
  --gold-main: #D4AF37;
  --gold-glow: #F9DA78;
  --cyan-main: #00E5FF;
  --cyan-glow: #70F3FF;
  --text-light: #F4F7FB;
  --text-muted: #8A9BB3;
  --danger: #FF4B4B;
  --success: #00FF88;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-dark);
  background-image: radial-gradient(circle at top right, rgba(0, 229, 255, 0.05), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(212, 175, 55, 0.05), transparent 40%);
  background-attachment: fixed;
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography elements */
.hl-gold { color: var(--gold-main); text-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
.hl-cyan { color: var(--cyan-main); text-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

/* Forms and Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--cyan-main);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%238A9BB3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 10px auto;
  cursor: pointer;
}

select.form-control option {
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 10px;
}

input[type="file"].form-control {
  padding: 8px 16px;
  cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-light);
  padding: 6px 16px;
  border-radius: 4px;
  margin-right: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Outfit', sans-serif;
}

input[type="file"].form-control::file-selector-button:hover {
  background: var(--cyan-main);
  color: #000;
  border-color: var(--cyan-main);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan-main), #009BB3);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
  background: linear-gradient(135deg, var(--cyan-glow), var(--cyan-main));
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-main), #B38F24);
  color: #000;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
  background: linear-gradient(135deg, var(--gold-glow), var(--gold-main));
}

.btn-danger {
  background: rgba(255, 75, 75, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-small { padding: 6px 12px; font-size: 0.8rem; }

/* Layouts */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(3, 11, 26, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar-brand img { height: 40px; }

/* Hamburger Menu Button (Hidden by default) */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.widget {
  padding: 1.5rem;
}

.widget h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
}

table tr:hover {
  background: rgba(255,255,255,0.02);
}

/* Utilities */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--cyan-main); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-glow); }

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: none;
}
.alert-error { background: rgba(255,75,75,0.2); border: 1px solid var(--danger); color: #fff; }
.alert-success { background: rgba(0,255,136,0.2); border: 1px solid var(--success); color: #fff; }

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(10, 20, 40, 0.95);
  border-left: 4px solid var(--cyan-main);
  color: #fff;
  padding: 15px 25px;
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 250px;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
}
.toast.toast-error { border-color: var(--danger); }
.toast.toast-warning { border-color: var(--gold-main); }
.toast.show { transform: translateX(0); opacity: 1; }

/* Mobile Responsiveness View */
@media (max-width: 768px) {
  /* Layout Adjustments */
  .container { padding: 1rem; }
  .admin-layout, .pos-main-layout { flex-direction: column; height: auto; }
  .main-content { padding: 1rem; }
  
  /* Sidebar as Drawer Layer */
  .mobile-menu-btn { display: block; }

  .sidebar { 
    position: fixed;
    top: 0;
    left: -100%; /* Hidden off-screen initially */
    width: 260px; 
    height: 100vh;
    background: rgba(3, 11, 26, 0.95);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255,255,255,0.1); 
    border-bottom: none;
    padding: 2rem 1rem; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start;
    gap: 30px;
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .sidebar.active {
    left: 0;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(4px);
  }
  .sidebar-overlay.active {
    display: block;
  }

  .sidebar h4 { display: block; margin-top: 2rem; color: var(--gold-glow); }
  .sidebar > div { display: flex; flex-direction: column; gap: 10px; align-items: stretch; width: 100%; }
  .btn-menu { margin-bottom: 5px; white-space: normal; padding: 12px 15px; font-size: 1rem; }
  .sidebar .btn { margin-bottom: 10px !important; width: 100% !important; white-space: normal; }

  /* Utilities */
  .flex-between { flex-direction: column; align-items: stretch; gap: 1rem; }
  
  /* Form & Grid Layouts */
  #orgForm { flex-direction: column; align-items: stretch; gap: 1rem; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 1rem; }
  .widget { padding: 1.2rem; overflow-x: auto; }
  
  /* Tables */
  table { white-space: nowrap; }
  
  /* POS Specifics */
  .pos-workspace { display: flex; flex-direction: column; gap: 1rem; height: auto; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .ticket-view { height: auto; border: 1px solid var(--gold-main); }
  .ticket-items { max-height: 250px; overflow-y: auto; }
  
  /* Navbar */
  .navbar { flex-direction: row; padding: 1rem; justify-content: space-between; text-align: left; }
  .navbar-brand { font-size: 1.2rem; }
  .navbar-brand img { height: 30px; }
  #userNameDisplay, #regStatus { display: none; } /* Hide extra nav details on mobile to save space */
  
  /* Modals */
  .modal { width: 95%; padding: 1.5rem; }
  .payment-methods { flex-wrap: wrap; text-align: center; }
  .payment-btn { flex-basis: 45%; font-size: 0.9rem; padding: 8px; }
  #v-open-register { margin: 2rem auto !important; }
}

/* Decorative Overlays */
.bh-badge {
    position: fixed;
    top: 4px;
    right: 6px;
    font-size: 9px;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.08); /* Extremely subtle, almost invisible */
    z-index: 9999;
    pointer-events: none;
    user-select: none;
}

.footer-quote {
    text-align: center;
    padding: 15px 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    width: 100%;
    margin-top: auto; /* Pushes to bottom in flex layouts */
}
.footer-quote .hebrew {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

/* Custom Overlays (Confirm & Loading) */
.ui-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.ui-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.ui-modal-box {
    background: #0f172a;
    border: 1px solid var(--gold-main);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.ui-overlay.show .ui-modal-box {
    transform: translateY(0);
}

.ui-modal-title {
    color: var(--gold-main);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: bold;
}
.ui-modal-text {
    color: #fff;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.ui-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top-color: var(--gold-main);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
