/* ===================================================
   Royal Wedding Admin Dashboard Styles
   =================================================== */

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

:root {
  --primary: #163a5e;
  --secondary: #215589;
  --royal: #2c6eb5;
  --gold: #c5a059;
  --dark-gold: #967434;
  --bg-main: #f4f7fb;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Alexandria', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
}

/* ================= Login Screen ================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0e1b29, #1b3552);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(197, 160, 89, 0.3);
}

.login-icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 25px;
}

/* ================= Dashboard Layout ================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background: #ffffff;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 25px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #eef4fb;
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active {
  border-right: 4px solid var(--royal);
}

.sidebar-footer {
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fee2e2;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.logout-btn:hover {
  background: #fee2e2;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.preview-site-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(22, 58, 94, 0.2);
  transition: transform 0.2s;
}

.preview-site-btn:hover {
  transform: translateY(-2px);
}

/* ================= KPI Stats Grid ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.gold { background: #fef3c7; color: #d97706; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

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

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ================= Card Container ================= */
.content-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 25px;
  margin-bottom: 30px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

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

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= RSVP Table ================= */
.search-input {
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  min-width: 220px;
}

.filter-select {
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background: #fff;
}

.export-btn {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.export-btn:hover {
  opacity: 0.9;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.data-table tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }

.action-btn-del {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.action-btn-del:hover {
  background: #fee2e2;
}

/* ================= Form Controls ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.field-input,
.field-textarea,
.field-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(44, 110, 181, 0.1);
}

.save-settings-btn {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 25px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.save-settings-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 58, 94, 0.25);
}

/* ================= Section Toggles ================= */
.toggles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.toggle-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

.toggle-card:hover {
  border-color: var(--royal);
  box-shadow: 0 4px 14px rgba(22, 58, 94, 0.08);
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.toggle-icon {
  font-size: 18px;
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
}

.toast-notice {
  position: fixed;
  bottom: 25px;
  left: 25px;
  background: var(--primary);
  color: #fff;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(13, 27, 42, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--royal);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ================= Timeline Builder Styles ================= */
.timeline-builder-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 13px;
}

.timeline-builder-table th,
.timeline-builder-table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.timeline-builder-table th {
  background: #f8fafc;
  color: var(--text-muted);
}

.add-event-box {
  background: #f8fafc;
  border: 1.5px dashed var(--royal);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

/* ================= Gallery Manager Styles ================= */
.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.gallery-manager-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.gallery-manager-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.gallery-item-del-btn:hover {
  transform: scale(1.1);
}

.upload-dropzone {
  border: 2px dashed var(--royal);
  border-radius: 14px;
  padding: 25px 20px;
  text-align: center;
  background: #f0f6fc;
  cursor: pointer;
  transition: background 0.2s;
}

.upload-dropzone:hover {
  background: #e2eefb;
}

/* ================= Music Uploader Box ================= */
.music-upload-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.music-preview-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 850px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
