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

:root {
  --bg: #f4f4f4;
  --fg: #2c3e50;
  --panel: #fff;
  --shadow: 0 2px 6px rgba(0,0,0,0.1);
  --card-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.2);
  --sidebar-bg: #2563eb;
  --sidebar-fg: #F0F0F0;
  --sidebar-hover: #dbeafe;
  --sidebar-active-text: #2563eb;
  --primary: #2980b9;
  --primary-hover: #3498db;
  --danger: #e74c3c;
  --success: #27ae60;
  --footer-fg: #7f8c8d;
}

body {
  font-family: 'Baloo 2', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--fg);
  transition: background 0.3s, color 0.3s;
}

body.darkmode {
  --bg: #181c24;
  --fg: #f4f4f4;
  --panel: #232b37;
  --shadow: 0 2px 10px rgba(0,0,0,0.6);
  --card-shadow-hover: 0 12px 24px rgba(0,0,0,0.35);
  --sidebar-bg: #11161e;
  --sidebar-fg: #e5e8ef;
  --sidebar-hover: #222a35;
  --primary: #3498db;
  --primary-hover: #2980b9;
  --danger: #e74c3c;
  --success: #27ae60;
  --footer-fg: #8c939c;
}

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  background-color: #1d4ed8;
}
#main-title {
  font-size: 6em;
  color: #ffffff;
  margin-bottom: 50px;
  text-transform: uppercase;
}
#main-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInText 1s ease-out forwards;
}
.form-container {
  background-color: var(--panel);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
  width: 300px;
  text-align: left;
  animation: slideUp 1.5s ease-out 0.5s forwards;
  color: var(--fg);
}
.form-container h2 {
    color: #1d4ed8;
    text-align: center;
    margin-bottom: 10px;
}
.form-container input,
.form-container button {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: var(--panel);
  color: var(--fg);
  transition: background 0.2s, color 0.2s;
}
.form-container input::placeholder { color: #aaa; }
.form-container button { background-color: #1d4ed8; color: white; font-size: 1.1rem; cursor: pointer; }
.form-container button:hover { background-color: #2563eb; }
.forgot-password-link {
  display: block;
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.forgot-password-link:hover { text-decoration: underline; }

/* =========================================
   NOTIFICATIONS
   ========================================= */
.notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #2980b9;
  color: white;
  padding: 15px;
  border-radius: 5px;
  display: none;
  font-size: 1rem;
  z-index: 4000;
  max-width: 90%;
  width: auto;
  min-width: 300px;
  text-align: center;
}
.notification.show {
  display: block;
  animation: slideIn 0.5s ease-out;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px) translateX(-50%); }
  to { opacity: 1; transform: translateY(0) translateX(-50%); }
}
@keyframes fadeInText {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  0% { transform: translateY(50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.dashboard-page {
  display: none;
  flex-direction: row;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  background: var(--bg);
  color: var(--fg);
}
.dashboard-page.active { opacity: 1; transform: translateY(0); }

/* Sidebar */
.sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  height: 100vh;
  color: var(--sidebar-fg);
  position: fixed;
  top: 0;
  left: 0;
  padding: 20px;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1000;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}
.sidebar-header img {
  width: 100%;
  max-width: 220px;
  display: block;
  margin: 0 auto;
}
.sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
  margin-top: 10px;
}
.profile-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db 60%, #2ecc71 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(44,62,80,0.15);
}
.profile-circle img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar a {
  color: var(--sidebar-fg);
  text-decoration: none;
  padding: 10px 0;
  display: block;
  transition: background 0.3s, padding-left 0.3s, color 0.3s;
  cursor: pointer;
  text-align: left;
  border-radius: 6px;
}
.sidebar a:hover {
  background-color: var(--sidebar-hover);
  padding-left: 10px;
  color: var(--sidebar-active-text);
}
.sidebar a.active {
  background-color: var(--sidebar-hover);
  color: var(--sidebar-active-text);
  font-weight: bold;
  padding-left: 10px;
}
.logout-link {
  margin-top: 40px;
  color: var(--danger);
  font-weight: bold;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 20px;
  margin-left: 220px;
  transition: background 0.3s, color 0.3s;
  background: var(--bg);
  color: var(--fg);
}
.topbar {
  background-color: #1d4ed8;
  color: #dbeafe;
  padding: 15px 20px;
  border-radius: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.topbar-icon-container {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#topbar-title {
  text-align: center;
  flex-grow: 1;
}
.back-btn {
  background-color: transparent;
  color: #dbeafe;
  border: 2px solid #dbeafe;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.back-btn:hover {
  background-color: rgba(219, 234, 254, 0.4);
}

.back-btn.hidden {
  display: none;
}
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 1s cubic-bezier(.42,0,.58,1) forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px);}
  to   { opacity: 1; transform: translateY(0);}
}

/* =========================================
   DASHBOARD CARDS
   ========================================= */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  width: 100%;
}
.card-medium {
  background-color: #3b82f6; 
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}
.card-medium:hover { transform: scale(1.03); }
.card-medium h3 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
}
.card-clickable {
    cursor: pointer;
}

/* =========================================
   SECTIONS & TRANSITIONS
   ========================================= */
.users-section,
.reports-section,
.settings-section,
.analytics-section,
.community-section,
.announcements-section,
.verification-section { display: none; }

.users-section.fade-slide,
.settings-section.fade-slide,
.analytics-section.fade-slide,
.community-section.fade-slide,
.announcements-section.fade-slide,
.verification-section.fade-slide,
#dashboardSection.fade-slide,
.reports-section.fade-slide {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s cubic-bezier(.42,0,.58,1), transform 0.6s cubic-bezier(.42,0,.58,1);
  will-change: opacity, transform;
}
#dashboardSection {
  padding: 20px;
}
.users-section.fade-slide.active,
.settings-section.fade-slide.active,
.analytics-section.fade-slide.active,
.community-section.fade-slide.active,
.announcements-section.fade-slide.active,
.verification-section.fade-slide.active,
#dashboardSection.fade-slide.active,
.reports-section.fade-slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  display: block;
}
.footer {
  text-align: center;
  padding: 20px;
  color: var(--footer-fg);
  font-size: 0.9rem;
  background: transparent;
}

/* =========================================
   USERS SECTION
   ========================================= */
.user-cards {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 30px;
  transition: box-shadow 0.3s, transform 0.3s, background 0.3s, color 0.3s;
  color: var(--fg);
}
.user-cards:hover {
  transform: translateY(-10px);
  box-shadow: var(--card-shadow-hover);
  z-index: 2;
}
#userTable { width: 100%; border-collapse: collapse; margin-top: 15px; }
#userTable th, #userTable td { padding: 10px; border: 1px solid #ccc; text-align: left; }
#userTable th { background-color: var(--primary); color: white; }

/* =========================================
   VERIFICATION SECTION
   ========================================= */
#verificationTable th, 
#verificationTable td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
}

#verificationTable tbody tr:hover {
  background-color: rgba(0,0,0,0.02);
}

.verify-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.verify-thumb:hover {
  transform: scale(1.1);
  border-color: var(--primary);
}

.verify-btn {
  background-color: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.verify-btn:hover {
  background-color: #219150;
}

/* Dark mode overrides for verification table */
body.darkmode #verificationTable th {
  background-color: #34495e;
}
body.darkmode #verificationTable td {
  border-color: #444;
}

/* =========================================
   SETTINGS SWITCHES
   ========================================= */
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}
.switch-label {
  font-size: 1rem;
  color: var(--fg);
  font-weight: 500;
  user-select: none;
}
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  vertical-align: middle;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.switch input:checked + .slider {
  background-color: #2980b9;
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* =========================================
   MODALS
   ========================================= */
.modal-bg {
  display: none;
  position: fixed; 
  top: 0; left: 0;
  width: 100vw; height: 100vh; 
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.modal-bg.active { 
  display: flex; 
  animation: fadeIn 0.3s ease-out;
}
.modal-box {
  background: var(--panel);
  color: var(--fg);
  border-radius: 10px;
  padding: 30px 24px 24px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.20);
  min-width: 300px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto; 
  position: relative;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-box h3 { margin-bottom: 18px; text-align:center;}
.modal-box label { display: block; margin-top: 10px; margin-bottom: 2px;}
.modal-box input[type=password],
.modal-box textarea {
  width: 100%; padding: 8px; border-radius: 4px; border: 1px solid #bbb;
  font-size: 1rem; margin-bottom: 8px; background: var(--panel); color: var(--fg);
  font-family: 'Baloo 2', 'Segoe UI', sans-serif;
}
.modal-box .modal-btns {
  margin-top: 12px; display: flex; gap: 10px; justify-content: flex-end;
}
.modal-box button {
  background: var(--primary); color: #fff; border: none; border-radius: 40px; padding: 8px 16px; cursor: pointer;
}
.modal-box button:hover { background: var(--primary-hover);}
.modal-close {
  position: absolute; top: 10px; right: 14px; font-size: 1.5rem; color: #888; background: none; border: none; cursor: pointer;
}
.modal-close:hover { color: var(--danger);}
.modal-error {
  color: var(--danger); font-size: 0.97em; margin-top: 2px; margin-bottom: 4px; text-align: center;
}
.modal-userinfo .modal-box {
  min-width: 320px;
  max-width: 95vw;
}
.modal-userinfo-details {
  font-size: 1.1em;
  padding: 10px 0;
  margin-bottom: 10px;
}
.modal-userinfo-details strong {
  color: #2980b9;
}

/* =========================================
   COMMUNITY SECTION
   ========================================= */
#communityPostsContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.community-post {
  background-color: var(--panel);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
  border: 2px solid transparent;
}
.community-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}
.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}
.post-header h4 {
  margin: 0;
  color: var(--primary);
  font-size: 1.1rem;
}
.post-meta {
  display: block;
  text-align: center;
  margin: -10px 0 15px 0;
  font-size: 0.85rem;
  color: var(--footer-fg);
}
.post-content {
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #eee;
  padding-top: 15px;
}
.post-actions-left {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; 
}
.like-btn, .comment-btn-post, .toggle-comments-btn, .edit-post-btn, .pin-post-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  color: var(--fg);
}
.like-btn:hover, .comment-btn-post:hover, .toggle-comments-btn:hover, .edit-post-btn:hover, .pin-post-btn:hover {
  background-color: #f0f5f9;
  border-color: #a2c6e0;
}
.comment-input-area {
  display: none;
  margin-top: 15px;
  gap: 10px;
}
.comment-input-area input {
  flex-grow: 1;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 8px;
}
.comment-input-area button {
  padding: 8px 15px;
  border-radius: 5px;
  border: none;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
}
.post-comments {
  display: none;
  margin-top: 15px;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
  font-size: 0.95rem;
  transition: max-height 0.3s ease-out;
  max-height: 0;
  overflow: hidden;
}
.post-comments.visible {
    display: block;
    max-height: 1000px;
}
.post-comments .comment {
  background-color: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
}
.community-post.pinned {
    order: -1; 
    border-color: var(--primary);
    background-color: #f0f5f9;
}
body.darkmode .community-post.pinned {
    background-color: #29384b;
}

/* =========================================
   GRAPH STYLES
   ========================================= */
.graph-container {
    background: var(--panel);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

body.darkmode .graph-container {
    background: var(--panel);
    color: var(--fg);
}

.date-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 15px;
}

/* =========================================
   REPORT CARDS
   ========================================= */
.report-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.report-card {
  background: var(--panel);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 20px;
  line-height: 1.6;
  border-left: 5px solid transparent;
  transition: border-color 0.3s, opacity 0.3s;
  position: relative;
  color: var(--fg);
}
.report-card .report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.report-card .report-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
}
.report-status.status-pending { background-color: #f39c12; }
.report-status.status-approved { background-color: var(--success); }
.report-status.status-disapproved { background-color: var(--danger); }

.report-card p.description {
    margin-top: 5px; 
    padding: 10px; 
    background: var(--bg); 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    word-wrap: break-word;
}
body.darkmode .report-card p.description {
    border-color: #444;
}
.report-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
.approve-btn { background-color: var(--success); color: #fff; border:none; padding: 8px 16px; border-radius: 6px; cursor:pointer; }
.disapprove-btn { background-color: var(--danger); color: #fff; border:none; padding: 8px 16px; border-radius: 6px; cursor:pointer; }
.approve-btn:hover { background-color: #27ae60; }
.disapprove-btn:hover { background-color: #c0392b; }

.report-card .comments-display-area {
  display: none;
  margin-top: 15px; 
  background: var(--bg); 
  border-radius: 6px; 
  padding: 12px; 
  font-size: 0.98em;
  border-top: 2px solid #eee;
}
.report-card .comments-display-area.visible { display: block; }
.report-card .comments-list .comment-item { 
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

/* =========================================
   ANNOUNCEMENTS
   ========================================= */
.create-announcement-box {
  background-color: var(--panel);
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
}
.create-announcement-box textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  font-size: 1rem;
  resize: vertical;
  background-color: var(--bg);
  color: var(--fg);
  margin: 10px 0 0 0;
}
.create-announcement-box button {
  padding: 10px 25px;
  border-radius: 5px;
  border: none;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
}
.announcement-history-box {
    background-color: var(--panel);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.announcement-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 15px;
    background-color: var(--bg);
    position: relative;
}
.announcement-item .badge-announcement { background-color: var(--primary); color:white; padding:3px 8px; border-radius:12px; font-size:0.8rem; font-weight:bold; }
.announcement-item .badge-service { background-color: var(--success); color:white; padding:3px 8px; border-radius:12px; font-size:0.8rem; font-weight:bold; }

/* =========================================
   CONTACTS
   ========================================= */
#contactCardsContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-card {
    background-color: var(--panel);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    color: var(--fg);
}
.contact-actions {
    text-align: right;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}
.scrollable-box {
  background-color: var(--panel);
  margin-top: 30px;
  margin-bottom: 40px;
  padding: 20px;
  border-radius: 10px;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  color: var(--fg);
}

/* =========================================
   PRINT STYLES
   ========================================= */
.print-report-btn {
    transition: background-color 0.2s, color 0.2s;
}
.print-report-btn:hover {
    background-color: #7f8c8d !important;
    color: white !important;
}


@media print {
  body * { visibility: hidden; }
  .report-card.print-focus,
  .report-card.print-focus * { visibility: visible; }
  .report-card.print-focus {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      margin: 0;
      padding: 20px;
      border: 1px solid #000;
      box-shadow: none;
      background-color: white;
      color: black;
  }
  .report-actions, 
  .print-report-btn,
  .delete-report-btn,
  .approve-btn,
  .disapprove-btn,
  .delete-btn,
  .sidebar,
  .topbar {
      display: none !important;
  }
}

/* =========================================
   SIMPLE DELETE BUTTON STYLES
   ========================================= */
.delete-btn {
    background-color: #e74c3c; 
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: #c0392b; 
}

.delete-post-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.delete-post-btn:hover {
    opacity: 1;
    background-color: #c0392b;
}

#userTable .delete-btn {
    padding: 4px 10px; 
    font-size: 0.85rem;
}