/* ==========================================================================
   Design Tokens & System Integration (Ojarumaru Admin Theme)
   ========================================================================== */

:root {
  /* Color Palette (Inherited/matched from main style.css) */
  --ocean-dark: #071d30;
  --ocean-medium: #0e2942;
  --ocean-blue: #1a5b8c;
  --ocean-light: #2c7bb5;
  --seafoam-mint: #e1f5fe;
  --seafoam-light: #f4fafc;
  --gold-accent: #d4af37;
  --gold-hover: #ffcf40;
  
  --text-dark: #1b2733;
  --text-light: #6a7c8e;
  --text-muted: #a4b3c1;
  --text-white: #ffffff;
  
  --bg-dark: #041220;
  --bg-light: #ffffff;
  --border-light: rgba(26, 91, 140, 0.15);
  --border-glass: rgba(255, 255, 255, 0.18);
  
  --box-shadow-premium: 0 10px 30px rgba(7, 29, 48, 0.08);
  --box-shadow-glass: 0 8px 32px 0 rgba(4, 18, 32, 0.2);
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  color: var(--text-dark);
  background-color: var(--seafoam-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-primary {
  background-color: var(--ocean-blue);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: var(--ocean-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(26, 91, 140, 0.2);
}

.btn-secondary {
  background-color: var(--seafoam-mint);
  color: var(--ocean-blue);
}

.btn-secondary:hover {
  background-color: rgba(26, 91, 140, 0.1);
  transform: translateY(-1px);
}

.btn-line {
  background-color: #06C755;
  color: var(--text-white);
}

.btn-line:hover {
  background-color: #05a647;
  transform: translateY(-1px);
}

.btn-danger {
  background-color: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background-color: #c0392b;
  transform: translateY(-1px);
}

/* Glass Card */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-premium);
}

/* ==========================================================================
   1. Passcode Login Page
   ========================================================================== */
.login-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--ocean-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem 2.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  box-shadow: var(--box-shadow-glass);
}

.login-header {
  margin-bottom: 2rem;
}

.login-header svg {
  margin-bottom: 1rem;
  color: var(--gold-accent);
}

.login-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 1.6rem;
  color: var(--text-white);
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

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

.login-card label {
  display: block;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255,255,255,0.15);
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-white);
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.3em;
  transition: var(--transition-smooth);
}

.login-card input[type="password"]:focus {
  outline: none;
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.error-msg {
  color: #ff6b6b;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: none;
}

/* ==========================================================================
   2. Main Layout (Sidebar & Panels)
   ========================================================================== */
.admin-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.admin-sidebar {
  width: 260px;
  background-color: var(--ocean-dark);
  color: var(--text-white);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  margin-bottom: 3rem;
  border-left: 3px solid var(--gold-accent);
  padding-left: 0.8rem;
}

.brand-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.sidebar-nav {
  flex-grow: 1;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.nav-tab-btn {
  width: 100%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-smooth);
}

.nav-tab-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

.nav-tab-btn.active {
  background-color: var(--ocean-blue);
  color: var(--text-white);
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.nav-tab-btn .badge-count {
  background-color: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
}

.logout-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  padding-left: 0.5rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.logout-link:hover {
  color: #ff6b6b;
}

/* Main Content Area */
.admin-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.content-header {
  background-color: var(--bg-light);
  padding: 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.content-header h1 {
  font-size: 1.4rem;
  color: var(--ocean-dark);
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-role {
  font-size: 0.8rem;
  font-weight: 600;
  background-color: var(--seafoam-mint);
  color: var(--ocean-blue);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
}

.content-body {
  padding: 2.5rem;
  flex-grow: 1;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  animation: panel-fade-in 0.3s ease-out;
}

.tab-panel.active {
  display: block;
}

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

/* ==========================================================================
   3. Dashboard Overview Page Widgets
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  padding: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-icon.bg-blue {
  background-color: rgba(26, 91, 140, 0.1);
  color: var(--ocean-blue);
}

.stat-icon.bg-gold {
  background-color: rgba(212, 175, 55, 0.15);
  color: var(--gold-accent);
}

.stat-icon.bg-green {
  background-color: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 600;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ocean-dark);
  line-height: 1.2;
  margin-top: 0.2rem;
}

.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}

.widget-card {
  background-color: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  padding: 2rem;
  box-shadow: var(--box-shadow-premium);
}

.widget-card h3 {
  font-size: 1.1rem;
  color: var(--ocean-dark);
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.how-to-use-list {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ==========================================================================
   4. Tables (Bookings & Catches)
   ========================================================================== */
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.widget-header h3 {
  border: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.btn-filter {
  background-color: var(--seafoam-light);
  color: var(--text-light);
  border: 1px solid var(--border-light);
  font-size: 0.78rem;
  padding: 0.3rem 0.8rem;
}

.btn-filter:hover, .btn-filter.active {
  background-color: var(--ocean-blue);
  color: #fff;
  border-color: var(--ocean-blue);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background-color: var(--seafoam-light);
  color: var(--ocean-dark);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--border-light);
}

.admin-table td {
  padding: 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  color: #3b4c5d;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background-color: rgba(44, 123, 181, 0.02);
}

/* Table image size */
.table-img {
  width: 50px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  background-color: var(--ocean-dark);
}

.table-placeholder-img {
  width: 50px;
  height: 38px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

/* Badges for status */
.badge-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
}

.badge-status.pending {
  background-color: #fef9e7;
  color: #f1c40f;
  border: 1px solid rgba(241, 196, 15, 0.2);
}

.badge-status.processing {
  background-color: rgba(26, 91, 140, 0.05);
  color: var(--ocean-blue);
  border: 1px solid rgba(26, 91, 140, 0.15);
}

.badge-status.completed {
  background-color: #eafaf1;
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   5. Forms (Live Status & Pricing Settings)
   ========================================================================== */
.form-widget {
  max-width: 720px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ocean-dark);
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  background-color: var(--seafoam-light);
  color: var(--text-dark);
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--ocean-blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(26, 91, 140, 0.10);
}

.select-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a5b8c' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

.status-radio-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.3rem;
}

.status-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.status-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ocean-blue);
  cursor: pointer;
}

.status-preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-preview-dot.green { background-color: #2ecc71; box-shadow: 0 0 6px #2ecc71; }
.status-preview-dot.yellow { background-color: #f1c40f; box-shadow: 0 0 6px #f1c40f; }
.status-preview-dot.red { background-color: #e74c3c; box-shadow: 0 0 6px #e74c3c; }

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ocean-blue);
  border-left: 3px solid var(--ocean-blue);
  padding-left: 0.6rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

/* ==========================================================================
   6. Modals (Overlays & Cards)
   ========================================================================== */
.modal-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(4, 18, 32, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-wrapper.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  border: 1px solid var(--border-light);
  box-shadow: 0 20px 50px rgba(4, 18, 32, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modal-pop 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--ocean-dark);
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover {
  color: var(--ocean-dark);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.2rem 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Image Upload Container UI */
.image-upload-wrapper {
  border: 2px dashed var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  background-color: var(--seafoam-light);
  cursor: pointer;
  transition: var(--transition-smooth);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-upload-wrapper:hover {
  border-color: var(--ocean-blue);
  background-color: rgba(26, 91, 140, 0.02);
}

.file-input {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
}

.file-size-limit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.image-upload-wrapper img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
  z-index: 5;
}

/* Reservation Detail List */
.booking-detail-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.detail-row {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.6rem;
  font-size: 0.88rem;
}

.detail-row strong {
  width: 150px;
  color: var(--ocean-dark);
  flex-shrink: 0;
}

.detail-row span {
  color: #3b4c5d;
}

.detail-message-box {
  background-color: var(--seafoam-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  color: #3b4c5d;
  width: 100%;
  white-space: pre-wrap;
  margin-top: 0.4rem;
  line-height: 1.6;
}

.status-label {
  font-weight: 700;
}

.status-label.pending { color: #f1c40f; }
.status-label.processing { color: var(--ocean-blue); }
.status-label.completed { color: #2ecc71; }

/* ==========================================================================
   7. Responsive Layout Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 200px;
    padding: 1.5rem 1rem;
  }
  .sidebar-brand {
    margin-bottom: 2rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-container {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1.2rem 1.5rem;
  }
  .sidebar-brand {
    margin-bottom: 1.2rem;
  }
  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .nav-tab-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }
  .content-header {
    padding: 1rem 1.5rem;
  }
  .content-body {
    padding: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .modal-card {
    max-height: 95vh;
  }
  .modal-body {
    padding: 1.2rem;
  }
  .form-group-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ==========================================================================
   8. Image Preview Grid (Multiple Images)
   ========================================================================== */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.preview-thumb-wrapper {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background-color: var(--seafoam-light);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.preview-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-thumb-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(231, 76, 60, 0.9);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  transition: var(--transition-smooth);
  z-index: 15;
}

.remove-thumb-btn:hover {
  background-color: #c0392b;
  transform: scale(1.1);
}
