/* ===== ADMIN SETTINGS PAGE LAYOUT (settings.html) ===== */

.topbar {
  background: linear-gradient(135deg, #0b5d1e 0%, #2e7d32 50%, #1b5e20 100%);
  color: #fff; padding: 14px 18px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.topbar p { margin: 0; font-size: 12px; opacity: 0.85; }
.topbar .backBtn {
  background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 18px;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
}
.saveTop {
  background: #22c55e; border: none; color: #fff; padding: 8px 16px;
  border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}

.layout {
  display: flex; min-height: calc(100vh - 60px);
}

.sidebar {
  width: 200px; background: #fff; border-right: 1px solid #e5e7eb;
  padding: 12px 0; overflow-y: auto; flex-shrink: 0;
}
.sidebar .nav {
  display: block; width: 100%; padding: 10px 16px; background: none;
  border: none; border-left: 3px solid transparent; text-align: left;
  font-size: 14px; color: #475569; cursor: pointer; transition: all 0.15s;
}
.sidebar .nav:hover { background: #f0fdf4; color: #176b35; }
.sidebar .nav.active {
  background: #f0fdf4; color: #176b35; font-weight: 700; border-left-color: #176b35;
}

.content {
  flex: 1; padding: 20px; overflow-y: auto;
}
.content .panel { display: none; }
.content .panel.active { display: block; }

#message {
  display: none; padding: 12px 16px; border-radius: 8px;
  margin-bottom: 16px; font-weight: 600; font-size: 14px;
}

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb;
    display: flex; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 4px;
    flex-shrink: 0;
  }
  .sidebar .nav {
    white-space: nowrap; padding: 8px 12px; border-radius: 20px;
    font-size: 12px; border-left: none;
  }
  .sidebar .nav.active { border-left: none; background: #176b35; color: #fff; }
  .content { padding: 16px; }
}

/* ===== ADMIN SETTINGS FORM STYLES (settings.html) ===== */

.content .panel h2 {
  font-size: 18px; font-weight: 700; color: #1f2937;
  margin: 0 0 20px; padding-bottom: 10px; border-bottom: 2px solid #e5e7eb;
}

.content label {
  display: block; margin-bottom: 16px; font-size: 14px; font-weight: 600; color: #374151;
}
.content label small { font-weight: 400; color: #9ca3af; }

.content input[type="text"],
.content input[type="number"],
.content input[type="email"],
.content input[type="url"],
.content input[type="color"],
.content input:not([type]),
.content select,
.content textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14px;
  color: #1f2937; background: #fff; box-sizing: border-box;
  transition: border-color 0.2s;
}
.content input:focus,
.content select:focus,
.content textarea:focus {
  border-color: #22c55e; outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}
.content textarea { min-height: 60px; resize: vertical; }
.content input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }

/* Toggle Switch */
.switch {
  display: flex !important; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid #f3f4f6; cursor: pointer;
}
.switch input[type="checkbox"] { display: none; }
.switch span {
  position: relative; width: 44px; height: 24px; background: #d1d5db;
  border-radius: 12px; transition: background 0.2s; flex-shrink: 0;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + span { background: #22c55e; }
.switch input:checked + span::after { transform: translateX(20px); }

/* Grid for subscription fields */
.grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.grid label { margin-bottom: 0; }

/* Status Box */
.statusbox {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #f8fafc; border-radius: 8px;
  margin-bottom: 8px; font-size: 14px;
}
.statusbox span { color: #6b7280; }
.statusbox b { color: #176b35; }

/* Warning */
.warning {
  background: #fef3c7; color: #92400e; padding: 12px 16px;
  border-radius: 8px; font-size: 13px; line-height: 1.5; margin-top: 16px;
}

/* Bottom Actions */
.bottomActions {
  display: flex; gap: 10px; padding: 16px 0; margin-top: 20px;
  border-top: 1px solid #e5e7eb; position: sticky; bottom: 0;
  background: #f8fafc; z-index: 5;
}
.bottomActions button {
  flex: 1; padding: 12px; border-radius: 10px; font-size: 15px;
  font-weight: 700; cursor: pointer; border: none; transition: all 0.15s;
}
.bottomActions .primary {
  background: linear-gradient(135deg, #176b35, #22c55e); color: #fff;
  box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}
.bottomActions .primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22,163,74,0.4); }
.bottomActions .secondary {
  background: #fff; color: #6b7280; border: 2px solid #e5e7eb;
}
.bottomActions .secondary:hover { background: #f9fafb; border-color: #d1d5db; }

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .content .panel h2 { font-size: 16px; }
}

/* ===== USER SETTINGS MODULE CSS ===== */

/* Side Menu */
.settings-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.45); z-index: 1998; display: none;
}
.settings-overlay.active { display: block; }

.side-menu {
  position: fixed; top: 0; right: 0; width: 300px; max-width: 85vw; height: 100%;
  background: #fff; z-index: 1999; box-shadow: -4px 0 30px rgba(0,0,0,0.2);
  display: none; flex-direction: column; overflow-y: auto;
}
.side-menu.active { display: flex; }

.side-menu-header {
  background: linear-gradient(135deg, #0b5d1e 0%, #2e7d32 50%, #1b5e20 100%);
  color: #fff; padding: 24px 20px; position: relative;
}
.side-menu-header h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.side-menu-header p { margin: 0; font-size: 12px; opacity: 0.85; }
.side-menu-close {
  position: absolute; top: 18px; right: 16px; background: rgba(255,255,255,0.2);
  border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.side-menu-close:hover { background: rgba(255,255,255,0.35); }

.side-menu-user {
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.side-menu-user-name { font-weight: 700; font-size: 15px; color: #1f2937; }
.side-menu-user-email { font-size: 12px; color: #6b7280; margin-top: 2px; }

.side-menu-nav { padding: 8px 0; flex: 1; }
.side-menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 20px;
  background: none; border: none; font-size: 15px; color: #1f2937; cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.side-menu-item:hover { background: #f8faf8; }
.side-menu-item-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.side-menu-divider { height: 1px; background: #e5e7eb; margin: 8px 0; }
.side-menu-logout { color: #dc2626; font-weight: 600; }

/* Settings Panel */
.settings-panel {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #f1f5f9; z-index: 2001; overflow-y: auto; display: none;
}
.settings-panel.active { display: block; }

.settings-topbar {
  background: linear-gradient(135deg, #0b5d1e 0%, #2e7d32 50%, #1b5e20 100%);
  color: #fff; padding: 16px 18px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.settings-back {
  background: rgba(255,255,255,0.2); border: none; color: #fff; font-size: 20px;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-back:hover { background: rgba(255,255,255,0.35); }
.settings-topbar h2 { margin: 0; font-size: 18px; font-weight: 700; }

.settings-body { padding: 16px; max-width: 600px; margin: 0 auto; }

/* Settings Home */
.settings-home-header { text-align: center; padding: 20px 0 10px; }
.settings-home-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #16a34a);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin: 0 auto 12px; box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}
.settings-home-header h2 { font-size: 22px; color: #1f2937; margin: 0 0 4px; }
.settings-home-header p { font-size: 13px; color: #6b7280; margin: 0; }

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 20px; }

.settings-card {
  background: #fff; border-radius: 14px; padding: 20px 14px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #f0f0f0; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.settings-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.settings-card-icon { font-size: 28px; }
.settings-card-label { font-size: 14px; font-weight: 600; color: #1f2937; }
.settings-card-desc { font-size: 11px; color: #6b7280; line-height: 1.3; }

/* Settings Section Pages */
.settings-section-title {
  font-size: 20px; font-weight: 700; color: #1f2937; margin-bottom: 4px;
}
.settings-section-desc { font-size: 13px; color: #6b7280; margin-bottom: 20px; }

.settings-card-section {
  background: #fff; border-radius: 14px; padding: 20px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #f0f0f0;
}
.settings-card-section-title {
  font-size: 14px; font-weight: 700; color: #176b35; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* Profile Section */
.profile-avatar-large {
  width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #22c55e, #16a34a);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 16px; box-shadow: 0 4px 12px rgba(34,197,94,0.25);
}
.profile-field { margin-bottom: 14px; }
.profile-field-label { font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-field-value { font-size: 15px; color: #1f2937; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }

/* Rate Rows */
.rate-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 0; border-bottom: 1px solid #f5f5f5;
}
.rate-row:last-child { border-bottom: none; }
.rate-label { font-size: 14px; font-weight: 600; color: #1f2937; flex: 1; }
.rate-desc { font-size: 11px; color: #6b7280; }
.rate-input {
  width: 110px; padding: 10px 12px; border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 15px; text-align: right; font-weight: 600; color: #1f2937; transition: border-color 0.2s;
}
.rate-input:focus { border-color: #22c55e; outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }

/* Form fields */
.field-group { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.field-input {
  width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 15px; color: #1f2937; box-sizing: border-box; transition: border-color 0.2s;
}
.field-input:focus { border-color: #22c55e; outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.field-input:disabled { background: #f8f9fa; color: #9ca3af; cursor: not-allowed; }
.field-textarea {
  width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 15px; color: #1f2937; resize: vertical; font-family: inherit;
  box-sizing: border-box; min-height: 100px;
}
.field-textarea:focus { border-color: #22c55e; outline: none; box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.field-select {
  width: 100%; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 10px;
  font-size: 15px; color: #1f2937; background: #fff; box-sizing: border-box;
}
.field-select:focus { border-color: #22c55e; outline: none; }

/* Buttons */
.settings-btn-primary {
  width: 100%; padding: 14px; background: linear-gradient(135deg, #176b35, #22c55e); color: #fff;
  border: none; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s; box-shadow: 0 4px 12px rgba(22,163,74,0.3);
  margin-top: 8px;
}
.settings-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22,163,74,0.4); }
.settings-btn-primary:active { transform: translateY(0); }

.settings-btn-secondary {
  width: 100%; padding: 14px; background: #fff; color: #176b35; border: 2px solid #176b35;
  border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background 0.15s; margin-top: 8px;
}
.settings-btn-secondary:hover { background: #f0fdf4; }

.settings-btn-danger {
  width: 100%; padding: 14px; background: #fff; color: #dc2626; border: 2px solid #dc2626;
  border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background 0.15s; margin-top: 8px;
}
.settings-btn-danger:hover { background: #fef2f2; }

/* Language Toggle */
.lang-toggle {
  display: flex; gap: 0; background: #f1f5f9; border-radius: 10px; padding: 3px;
  margin-bottom: 20px; border: 1px solid #e2e8f0;
}
.lang-toggle-btn {
  flex: 1; padding: 10px; border: none; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all 0.2s; background: transparent; color: #64748b;
}
.lang-toggle-btn.active { background: #fff; color: #176b35; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

/* Policy Content */
.policy-content {
  font-size: 14px; line-height: 1.8; color: #374151;
}
.policy-content h4 {
  color: #176b35; font-size: 16px; font-weight: 700; margin: 24px 0 8px;
  padding-bottom: 4px; border-bottom: 2px solid #f0fdf4;
}
.policy-content p { margin: 8px 0; }
.policy-content ul { margin: 8px 0; padding-left: 24px; }
.policy-content li { margin: 4px 0; }
.policy-content strong { color: #1f2937; }

/* Rating Stars */
.rating-group { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-option {
  flex: 1; min-width: 60px; padding: 12px 8px; border: 2px solid #e5e7eb; border-radius: 10px;
  text-align: center; cursor: pointer; transition: all 0.15s; background: #fff;
}
.rating-option:hover { border-color: #22c55e; }
.rating-option.selected { border-color: #22c55e; background: #f0fdf4; }
.rating-option input[type="radio"] { display: none; }
.rating-stars { font-size: 20px; }
.rating-label { font-size: 11px; color: #6b7280; margin-top: 4px; }

/* Success/Error Messages */
.settings-msg {
  padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  margin-bottom: 14px; display: none; animation: settingsFadeIn 0.3s ease;
}
.settings-msg.success { display: block; background: #f0fdf4; color: #176b35; border: 1px solid #bbf7d0; }
.settings-msg.error { display: block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

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

/* Loading */
.settings-loading {
  text-align: center; padding: 40px 20px; color: #6b7280; font-size: 15px;
}
.settings-loading::before {
  content: ""; display: block; width: 36px; height: 36px; border: 3px solid #e5e7eb;
  border-top-color: #22c55e; border-radius: 50%; margin: 0 auto 12px;
  animation: settingsSpin 0.8s linear infinite;
}
@keyframes settingsSpin { to { transform: rotate(360deg); } }

/* Info Cards */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: #6b7280; }
.info-value { color: #1f2937; font-weight: 600; }

/* Info Badge */
.info-badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-green { background: #f0fdf4; color: #176b35; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-gray { background: #f9fafb; color: #6b7280; }

/* Mobile */
@media (max-width: 480px) {
  .settings-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .settings-card { padding: 16px 10px; }
  .settings-card-icon { font-size: 24px; }
  .settings-card-label { font-size: 13px; }
  .rate-input { width: 90px; font-size: 14px; padding: 8px 10px; }
  .settings-body { padding: 12px; }
  .rating-group { gap: 6px; }
  .rating-option { min-width: 55px; padding: 10px 6px; }
}

@media (min-width: 768px) {
  .settings-grid { grid-template-columns: repeat(3, 1fr); }
}
