/**
 * BeSocial Core Application Design System
 * Baseline: DM Sans, DM Serif Display, Brand Forest (#173f35), Cream (#fff8e9), Coral (#f47a54)
 */

@import url('./fonts.css');

:root {
  --brand-forest: #173f35;
  --brand-forest-hover: #10352c;
  --brand-cream: #fff8e9;
  --brand-coral: #f47a54;
  --brand-coral-hover: #e06843;
  --app-background: #f6f8f5;
  --surface: #ffffff;
  --surface-subtle: #eef2eb;
  --text-primary: #172b25;
  --text-secondary: #52615a;
  --text-muted: #798b82;
  --border-subtle: #d7dfd6;
  --border-control: #7b8b81;
  --focus-ring: #173f35;
  --success: #256343;
  --success-surface: #eaf4eb;
  --warning: #825415;
  --warning-surface: #fff3d6;
  --danger: #b1382d;
  --danger-surface: #fff0ec;
  --info: #255775;
  --info-surface: #edf4fa;

  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(23, 43, 37, 0.05);
  --shadow-md: 0 4px 12px rgba(23, 43, 37, 0.08);
  --shadow-lg: 0 10px 24px rgba(23, 43, 37, 0.12);

  --sidebar-width: 250px;
  --header-height: 64px;
  --bottom-nav-height: 68px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--app-background);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Utility Classes & Layouts
   ========================================================================== */

.container-app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-forest);
  color: var(--brand-cream);
  padding: 8px 16px;
  z-index: 100;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus {
  top: 10px;
  left: 10px;
}

/* Form controls */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input.is-invalid, .form-select.is-invalid, .form-textarea.is-invalid {
  border-color: var(--danger);
}

.form-error {
  display: block;
  font-size: 13px;
  color: var(--danger);
  margin-top: 5px;
}

.form-hint {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  text-align: center;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background-color: var(--brand-forest);
  color: var(--brand-cream);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-forest-hover);
}

.btn-coral {
  background-color: var(--brand-coral);
  color: #ffffff;
}
.btn-coral:hover:not(:disabled) {
  background-color: var(--brand-coral-hover);
}

.btn-secondary {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
  background-color: #e2e8df;
}

.btn-outline {
  background: transparent;
  color: var(--brand-forest);
  border: 1.5px solid var(--brand-forest);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--brand-forest);
  color: var(--brand-cream);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background-color: #962c22;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Badges & Status Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success { background: var(--success-surface); color: var(--success); }
.badge-warning { background: var(--warning-surface); color: var(--warning); }
.badge-danger { background: var(--danger-surface); color: var(--danger); }
.badge-info { background: var(--info-surface); color: var(--info); }
.badge-neutral { background: var(--surface-subtle); color: var(--text-secondary); }

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-success { background: var(--success-surface); color: var(--success); border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-surface); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-surface); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info { background: var(--info-surface); color: var(--info); border-left: 4px solid var(--info); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--surface-subtle);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: var(--surface-subtle);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: #fafcf9;
}

/* Tab navigation */
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-link:hover {
  color: var(--text-primary);
}

.tab-link.active {
  color: var(--brand-forest);
  border-bottom-color: var(--brand-forest);
}

/* ==========================================================================
   Owner Layout (5 Dest: Dashboard, Guests, Events & Offers, Feedbacks, Settings)
   ========================================================================== */

.owner-layout {
  display: flex;
  min-height: 100vh;
}

.owner-sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--surface-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 0.15s, color 0.15s;
}

.nav-item:hover {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--brand-forest);
  color: var(--brand-cream);
  font-weight: 600;
}

.nav-item.active .besocial-icon {
  stroke: var(--brand-cream);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--surface-subtle);
}

.owner-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.owner-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.venue-pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-forest);
  background: var(--surface-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.owner-content {
  padding: 28px;
  flex: 1;
}

/* Mobile Bottom Navigation (Strictly 5 items: Home, Guests, Events, Feedback, Settings) */
.owner-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  min-height: 48px;
}

.bottom-nav-item.active {
  color: var(--brand-forest);
}

.bottom-nav-item.active .besocial-icon {
  stroke: var(--brand-forest);
}

/* Responsive Breakpoint for Mobile Bottom Nav (< 900px) */
@media (max-width: 899px) {
  .owner-sidebar {
    display: none;
  }
  .owner-main {
    margin-left: 0;
  }
  .owner-bottom-nav {
    display: flex;
  }
  .owner-content {
    padding: 20px 16px;
    padding-bottom: calc(var(--bottom-nav-height) + 24px + env(safe-area-inset-bottom));
  }
  .owner-header {
    padding: 0 16px;
  }
}

/* ==========================================================================
   Guest QR Experience (Deliberately Minimal, 320px–440px)
   ========================================================================== */

.guest-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
  background: #f6f8f5;
}

.guest-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  padding: 32px 24px;
  text-align: center;
}

.guest-brand-logo {
  max-width: 160px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
}

.guest-venue-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-forest);
  margin-bottom: 6px;
}

.guest-welcome-copy {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Star rating component */
.star-rating-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}

.star-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--border-control);
  transition: transform 0.15s, color 0.15s;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.star-btn:hover, .star-btn:focus-visible {
  outline: none;
  transform: scale(1.15);
  color: #f59e0b;
}

.star-btn.is-selected {
  color: #f59e0b;
}

.star-btn.is-selected svg {
  fill: #f59e0b;
}

/* Keyword chips */
.keyword-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.keyword-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.keyword-chip:hover {
  border-color: var(--brand-forest);
}

.keyword-chip.is-active {
  background: var(--brand-forest);
  color: var(--brand-cream);
  border-color: var(--brand-forest);
}

/* ==========================================================================
   Super Admin Layout (Grouped Sidebar / Accessible Mobile Drawer)
   ========================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 270px;
  background: #102620;
  color: #eef2eb;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  overflow-y: auto;
}

.admin-sidebar .sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b1a16;
}

.admin-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #798b82;
  padding: 16px 14px 6px;
  font-weight: 700;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #c4d1c9;
  transition: all 0.15s;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.admin-nav-item.active {
  background: var(--brand-coral);
  color: #ffffff;
  font-weight: 600;
}

.admin-main {
  flex: 1;
  margin-left: 270px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 899px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease-in-out;
  }
  .admin-sidebar.is-open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
}

/* Table Pagination & Per-Page Controls */
.table-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: #fafbf9;
  flex-wrap: wrap;
  gap: 14px;
}

.table-pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.table-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.table-per-page select {
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.custom-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.custom-pagination a,
.custom-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.custom-pagination a:hover {
  background: var(--bg-hover);
  border-color: var(--brand-forest);
}

.custom-pagination .active span {
  background: var(--brand-forest);
  color: #ffffff;
  border-color: var(--brand-forest);
  font-weight: 700;
}

.custom-pagination .disabled span {
  color: #a0aec0;
  background: #f7fafc;
  cursor: not-allowed;
  border-color: #edf2f7;
}

.table th.row-num-col,
.table td.row-num-col {
  width: 52px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: monospace;
}

/* Password Visibility Toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 44px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 4px;
  margin: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.15s ease-in-out;
}

.password-toggle-btn:hover {
  color: var(--brand-forest);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--brand-coral);
}


