/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  --primary-color: #1e75ec;
  --primary-hover: #155ec2;
  --primary-light: #e6f1fe;
  --primary-gradient: linear-gradient(135deg, #1e75ec 0%, #0d55c7 100%);
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --bg-color: #f6f8fb;
  --card-bg: #ffffff;
  --text-main: #1a202c;
  --text-muted: #718096;
  --border-color: #edf2f7;
  --error-color: #e53e3e;
  --success-color: #10b981;
  --success-light: #ecfdf5;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.03), 0 4px 6px -2px rgba(0,0,0,0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
  --shadow-premium: 0 15px 30px rgba(30, 117, 236, 0.08);
  --font-main: 'Poppins', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header & Navbar (Desktop UI) */
header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 48px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: var(--primary-light);
}

.nav-link.active {
  color: var(--primary-color);
  background-color: var(--primary-light);
}

.btn-create {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-create:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--border-color);
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.profile-pill:hover {
  background-color: #cbd5e0;
}

.profile-avatar {
  background-color: var(--primary-color);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Page Container Layout */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.page-title h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 16px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: white;
  color: var(--text-main);
  border: 1px solid #cbd5e0;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-secondary:hover {
  background-color: var(--bg-color);
  border-color: #a0aec0;
}

.btn-danger {
  background-color: var(--error-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-normal);
}

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

/* Campaign Grid (Desktop UI) */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.campaign-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.campaign-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.campaign-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.campaign-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.campaign-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 54px;
}

.campaign-card-stats {
  margin-top: auto;
}

.campaign-card-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.campaign-card-amount span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.progress-bar-container {
  background-color: #edf2f7;
  height: 8px;
  border-radius: 4px;
  margin: 12px 0 20px 0;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent-gradient);
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 2.5s infinite linear;
}

@keyframes progress-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.btn-card-action {
  width: 100%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-align: center;
}

.btn-card-action:hover {
  background-color: var(--primary-hover);
}

/* Explore Screen Elements */
.search-filter-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #f1f3f5;
  font-size: 16px;
  transition: var(--transition-normal);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(30,117,236,0.15);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

.category-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  background-color: white;
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-normal);
}

.category-chip:hover {
  border-color: #cbd5e0;
  color: var(--text-main);
}

.category-chip.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
}

.empty-icon-wrap {
  width: 80px;
  height: 80px;
  background-color: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 32px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 400px;
  margin-bottom: 24px;
}

/* Detail Page Layout (Desktop Split) */
.detail-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.detail-left {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-right {
  flex: 1;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cover-image-container {
  width: 100%;
  height: 450px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.campaign-detail-card {
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.campaign-title-detail {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}

.organizer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 24px;
}

.organizer-avatar {
  background: var(--primary-gradient);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(30, 117, 236, 0.15);
  font-family: var(--font-heading);
}

.organizer-info span {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.organizer-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.campaign-desc-detail {
  font-size: 16px;
  color: #4a5568;
  line-height: 1.7;
  white-space: pre-line;
}

/* Badges & Trust Tags */
.campaign-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 30px;
  font-family: var(--font-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.badge-verified {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-verified ion-icon {
  font-size: 14px;
  color: var(--success-color);
}

.badge-category {
  background-color: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid rgba(30, 117, 236, 0.1);
}

.badge-category ion-icon {
  font-size: 14px;
}

.donations-card {
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title-bar h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
}

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

.donors-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.donor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: var(--bg-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-normal);
}

.donor-item:hover {
  background-color: var(--primary-light);
}

.donor-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.donor-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 15px;
}

.donor-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.donor-info span {
  font-size: 12px;
  color: var(--text-muted);
}

.donor-amount {
  font-weight: 700;
  color: var(--primary-color);
}

/* Sidebar Widget (Desktop Details) */
.donation-widget {
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid rgba(30, 117, 236, 0.06);
  padding: 32px;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget-raised {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.widget-goal {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.widget-donors-count {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.amount-selector-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amount-selector-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.amount-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.amount-chip {
  background-color: white;
  border: 1px solid var(--border-color);
  padding: 12px 10px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  color: var(--text-main);
}

.amount-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(30, 117, 236, 0.06);
}

.amount-chip.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 6px 15px rgba(30, 117, 236, 0.2);
}

.custom-amount-input-wrap {
  position: relative;
}

.custom-amount-symbol {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
}

.custom-amount-input {
  width: 100%;
  padding: 14px 16px 14px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-normal);
  color: var(--text-main);
  outline: none;
}

.custom-amount-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(30, 117, 236, 0.1);
}

.donation-widget-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-donate-widget {
  width: 100%;
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
  box-shadow: 0 4px 12px rgba(30, 117, 236, 0.15);
}

.btn-donate-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 117, 236, 0.25);
}

.btn-donate-widget:active {
  transform: translateY(0);
}

.btn-share-widget {
  width: 100%;
  background-color: white;
  color: var(--text-main);
  border: 1px solid #cbd5e0;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-normal);
}

.btn-share-widget:hover {
  background-color: #fafbfc;
  border-color: #a0aec0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.btn-share-widget:active {
  transform: translateY(0);
}

/* Form Styles (Create Campaign) */
.form-card {
  max-width: 700px;
  margin: 0 auto;
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-weight: 600;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: #f1f3f5;
  font-size: 15px;
  transition: var(--transition-normal);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
}

.form-control-icon-wrap {
  position: relative;
}

.form-control-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-control-icon-wrap .form-control {
  padding-left: 44px;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-char-count {
  align-self: flex-end;
  font-size: 12px;
  color: var(--text-muted);
}

.form-helper {
  font-size: 13px;
  color: var(--text-muted);
}

/* Image Upload Area */
.image-upload-zone {
  border: 2px dashed #cbd5e0;
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.image-upload-zone:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.upload-icon {
  font-size: 40px;
  color: var(--text-muted);
  transition: var(--transition-normal);
}

.image-upload-zone:hover .upload-icon {
  color: var(--primary-color);
}

.upload-text-main {
  font-size: 15px;
  font-weight: 600;
}

.upload-text-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-preview-container {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
}

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

.upload-preview-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0,0,0,0.6);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-normal);
}

.upload-preview-remove:hover {
  background-color: rgba(229, 62, 62, 0.9);
}

.form-footer-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.form-footer-buttons button {
  flex: 1;
}

/* Authentication Layout */
.auth-container {
  max-width: 440px;
  margin: 60px auto;
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-img {
  height: 60px;
  object-fit: contain;
  margin-bottom: 20px;
}

.auth-header h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
}

.auth-toggle {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
}

.auth-toggle-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-normal);
}

.auth-toggle-tab.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: -2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit-btn {
  margin-top: 8px;
}

.auth-switch-text {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 20px;
}

.auth-switch-link {
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
}

/* Common Modal Window Dialog Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.9);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition-normal);
}

.modal-close-btn:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notification styling */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #2d3748;
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

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

.toast-success {
  background-color: var(--success-color);
}

.toast-error {
  background-color: var(--error-color);
}

/* Spinner Styles */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--primary-color);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MOBILE UI/UX STYLES (< 768px viewport)
   Translates layouts to native application screens in mobile browser view
   ========================================================================== */

/* Mobile Navigation Drawer / Hamburger Menu fallback (hidden by default) */
.mobile-nav-toggle {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
}

@media (max-width: 768px) {
  /* Global Adjustments */
  .page-container {
    padding: 16px;
  }

  /* Header adjustments for Mobile (App Bar look) */
  header {
    position: sticky;
    top: 0;
    box-shadow: var(--shadow-sm);
  }

  .navbar {
    padding: 10px 16px;
  }

  .logo-img {
    height: 38px;
  }

  /* Hide Desktop navigation items */
  .nav-links {
    display: none;
  }

  /* Show a mobile app header layout: center page titles */
  .mobile-app-bar {
    background-color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 59px; /* offset height of main header */
    z-index: 99;
  }

  .mobile-app-bar-back {
    font-size: 18px;
    margin-right: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
  }

  .mobile-app-bar-title {
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    flex-grow: 1;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Page Header to stack vertically on Mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
  }

  .page-title h1 {
    font-size: 24px;
  }

  .page-title p {
    font-size: 14px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions button {
    flex-grow: 1;
    justify-content: center;
  }

  .btn-create, .page-header .btn-primary {
    display: none; /* Hide primary create campaign button from headers; we'll use FAB on Mobile */
  }

  /* Mobile Floating Action Button (FAB) */
  .mobile-fab {
    display: flex;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(30,117,236,0.3);
    z-index: 999;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-normal);
  }

  .mobile-fab:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
  }

  /* Tab View for Dashboard on Mobile (matching Flutter app) */
  .mobile-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    background-color: white;
  }

  .mobile-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-normal);
  }

  .mobile-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -2px;
  }

  /* Mobile Campaign Cards Layout: Row formats (Flutter implementation) */
  .campaign-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .campaign-card {
    flex-direction: row;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .campaign-card-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    order: 2; /* Move image to the right side */
    margin-left: 12px;
  }

  .campaign-card-content {
    padding: 0;
    order: 1; /* Keep content on the left */
    flex-grow: 1;
  }

  .campaign-card-title {
    font-size: 16px;
    height: auto;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
  }

  .campaign-card-amount {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .campaign-card-amount span {
    font-size: 12px;
  }

  /* Hide progress bar and primary button on mobile list view (matching app UI) */
  .campaign-card .progress-bar-container,
  .campaign-card .btn-card-action {
    display: none;
  }

  /* Show a subtle "Edit ->" or "View ->" text row at bottom of card */
  .campaign-card-action-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
  }

  /* Explore Filters Screen on Mobile */
  .category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .category-chip {
    flex-shrink: 0;
  }

  /* Details Page Mobile UX */
  .detail-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    width: 100%;
  }

  .detail-left, .detail-right {
    display: contents; /* Allows children to be direct flex items of .detail-layout */
  }

  .mobile-detail-stats {
    order: 1;
    display: flex !important; /* Force visible */
    background-color: white;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    gap: 12px;
  }

  .cover-image-container {
    order: 2;
    height: 220px;
    border-radius: var(--radius-md);
    margin: 0;
    border: 1px solid var(--border-color);
  }

  .donation-widget {
    order: 3;
    width: calc(100% + 32px);
    padding: 24px 16px;
    border-radius: 0;
    margin: 0 -16px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    background-color: white;
    position: static; /* Remove sticky positioning on mobile */
  }

  /* Hide progress bar and stats inside the action widget on mobile */
  .donation-widget > div:first-child,
  .donation-widget > .progress-bar-container,
  .donation-widget > .widget-donors-count {
    display: none !important;
  }

  .campaign-detail-card {
    order: 4;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
  }

  .campaign-title-detail {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .organizer-row {
    padding: 12px 0;
    margin-bottom: 16px;
  }

  .campaign-desc-detail {
    font-size: 14px;
  }

  /* Donations and Donors Card */
  .donations-card {
    order: 5;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
  }

  .donor-item {
    padding: 10px;
  }

  /* Form responsive spacing */
  .form-card {
    padding: 20px 16px;
    border-radius: 0;
    margin: 0 -16px;
    border: none;
    box-shadow: none;
  }

  .form-footer-buttons {
    flex-direction: column-reverse;
  }
}

/* Helper Class to show mobile layouts only */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }
  .desktop-only {
    display: none !important;
  }
}

/* Share Option micro-animations */
.share-option:hover div {
  transform: scale(1.1);
}
.share-option:active div {
  transform: scale(0.95);
}
