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

body, html {
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  color: #e0f2f1; /* Primary text color */
  background: linear-gradient(-45deg, #004d40, #00394d, #00695c, #004d40); /* Darker, richer green/blue gradient */
  background-size: 400% 400%;
  animation: backgroundShift 20s ease infinite;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Nature-inspired background animation */
@keyframes backgroundShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === DASHBOARD LAYOUT === */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: rgba(0, 77, 64, 0.95);
  color: #e0f2f1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 30px 0;
  box-shadow: 2px 0 16px rgba(0,0,0,0.12);
  z-index: 10;
}

.sidebar-header {
  padding: 32px 0 24px 0;
  text-align: center;
  border-bottom: 1px solid rgba(38, 166, 154, 0.2);
}

.sidebar-header h2 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #81c784;
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  margin-top: 32px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 8px;
}

.sidebar-nav a {
  display: block;
  padding: 14px 32px;
  color: #e0f2f1;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a:focus {
  background: rgba(38, 166, 154, 0.12);
  color: #81c784;
  border-left: 4px solid #26a69a;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 0 0;
}

.app-header {
  margin: 0 0 32px 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: rgba(0, 77, 64, 0.7);
  padding: 32px 40px 24px 40px;
  text-align: left;
}

.app-header h1 {
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.app-header p {
  color: #b2dfdb;
  font-size: 1.1rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 32px;
  max-width: 1200px;
  margin: 0 auto 32px auto;
  width: 100%;
}

.card {
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 32px 28px;
  margin-bottom: 0;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(38, 166, 154, 0.13);
}

/* Make single-column for smaller screens */
@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-gap: 24px;
  }
  .main-content {
    padding: 0;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 70px;
    min-width: 70px;
    padding: 0;
  }
  .sidebar-header h2 {
    font-size: 1.1rem;
    letter-spacing: 0;
  }
  .sidebar-nav a {
    padding: 12px 10px;
    font-size: 0.98rem;
    text-align: center;
  }
  .sidebar-nav a span {
    display: none;
  }
}

@media (max-width: 700px) {
  .dashboard-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(38, 166, 154, 0.2);
  }
  .sidebar-header, .sidebar-nav {
    padding: 0;
    margin: 0;
  }
  .sidebar-header {
    display: none;
  }
  .sidebar-nav ul {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }
  .sidebar-nav li {
    margin: 0;
  }
  .sidebar-nav a {
    padding: 14px 8px;
    font-size: 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .sidebar-nav a:hover, .sidebar-nav a:focus {
    border-bottom: 3px solid #26a69a;
    border-left: none;
  }
}

/* Report Case Form Enhancements */
.report-case form .form-group textarea {
  min-height: 90px;
  resize: vertical;
  font-size: 1rem;
  background: rgba(0,0,0,0.18);
  color: #e0f2f1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 12px;
}

.report-case form .form-group input[type="file"] {
  background: none;
  color: #b2dfdb;
  border: none;
  padding: 0;
}

#reportStatus {
  margin-top: 18px;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

/* Card grid for stats */
.stats-grid {
  display: flex;
  gap: 24px;
}
@media (max-width: 700px) {
  .stats-grid {
    flex-direction: column;
    gap: 12px;
  }
}

/* Nature-themed divider */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, #26a69a, #66bb6a);
  margin: 30px 0;
  opacity: 0.5;
}

/* Header Styling */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.header-left {
  flex: 1;
}

.header-left h1 {
  font-size: 2.2rem; /* Slightly smaller for better fit */
  background: linear-gradient(to right, #81c784, #4db6ac);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.header-left p {
  color: #b2dfdb;
  font-size: 1rem;
}

/* User Profile */
.user-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 200px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.user-info span:first-child {
  font-weight: 600;
  color: #81c784;
  font-size: 1.1rem;
}

.user-email {
  font-size: 0.9rem;
  color: #b2dfdb;
  opacity: 0.8;
}

.logout-button {
  padding: 8px 16px;
  background: linear-gradient(to right, #ff6b6b, #ee5a52);
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

.logout-button:hover {
  background: linear-gradient(to right, #ee5a52, #ff6b6b);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.logout-button:active {
  transform: translateY(0);
}

/* Buttons */
.button {
  width: 100%;
  padding: 14px;
  margin: 15px 0;
  background: linear-gradient(to right, #26a69a, #66bb6a);
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.5px;
  transform: scale(1);
  -webkit-user-select: none;
  user-select: none;
}

.button:hover {
  background: linear-gradient(to right, #66bb6a, #26a69a);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 6px 15px rgba(38, 166, 154, 0.4);
}

.button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.donate-button {
  background: linear-gradient(to right, #ffa726, #ffb74d);
}

.donate-button:hover {
  background: linear-gradient(to right, #ffb74d, #ffa726);
  box-shadow: 0 6px 15px rgba(255, 167, 38, 0.4);
}

.donate-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Form & Inputs */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #b2dfdb;
  font-size: 0.95rem;
  font-weight: 500;
}

input, select {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: #e0f2f1;
  font-size: 1rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #4db6ac;
  box-shadow: 0 0 0 4px rgba(77, 182, 172, 0.4);
}

/* Wallet Info */
.wallet-info {
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 30px;
}

.balance-info {
  font-size: 1.4rem;
  margin-top: 10px;
  font-weight: 600;
  color: #81c784;
}

.balance-info span:first-child {
  color: #b2dfdb;
  font-weight: 500;
}

/* Impact Stats */
#impactStats {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0;
}

.stat-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-card h3 {
  color: #b2dfdb;
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 500;
}

.stat-card p {
  color: #81c784;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Transaction History */
.transaction-history {
  margin-top: 40px;
}

.transaction-history h2, .transaction-history h3 {
  color: #b2dfdb;
  margin-bottom: 20px;
  font-weight: 600;
}

.history-list {
  list-style: none;
  padding: 0;
}

.history-list li.history-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid #26a69a;
  transition: all 0.3s ease;
}

.history-list li.history-item:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(5px);
}

.history-item .history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-item .project-name {
  font-weight: 600;
  color: #81c784;
  font-size: 1.1rem;
}

.history-item .donation-amount {
  font-weight: 700;
  color: #ffa726;
  font-size: 1.2rem;
}

.history-item .history-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #b2dfdb;
  opacity: 0.8;
}

.history-item .project-impact {
  color: #66bb6a;
  font-weight: 500;
}

.history-item .donation-timestamp {
  font-style: italic;
}

/* Donation Status */
#donationStatus {
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

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

.success {
  background: rgba(81, 207, 102, 0.2);
  border: 1px solid #51cf66;
  color: #51cf66;
}

.error {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

footer {
  text-align: center;
  padding: 20px;
  color: #b2dfdb;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: auto;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #26a69a, #66bb6a);
  border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .dashboard {
    width: 95%;
    margin: 20px auto;
    padding: 20px;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .header-left h1 {
    font-size: 1.8rem;
  }

  .user-profile {
    align-items: center;
    min-width: auto;
  }

  #impactStats {
    flex-direction: column;
    gap: 15px;
  }

  .stat-card {
    padding: 15px;
  }

  .history-item .history-header,
  .history-item .history-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

@media (max-width: 540px) {
  .dashboard {
    width: 98%;
    margin: 10px auto;
    padding: 15px;
  }

  .app-header {
    padding: 15px;
  }

  .header-left h1 {
    font-size: 1.5rem;
  }

  #impactStats {
    gap: 10px;
  }
}

@media (max-width: 400px) {
  .dashboard {
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .header-left h1 {
    font-size: 1.3rem;
  }

  .button, input, select {
    padding: 12px;
    font-size: 0.9rem;
  }

  .balance-info,
  .stat-card p {
    font-size: 1.4rem;
  }

  .history-list li {
    padding: 12px;
  }
}

/* Additional responsive adjustments */
@media (max-width: 600px) {
  body {
    background-attachment: fixed;
  }

  main {
    flex: 1;
  }

  footer {
    margin-top: 20px;
  }
}