:root {
  --primary-color: #2E7D32;
  --primary-light: #4CAF50;
  --primary-dark: #1B5E20;
  --secondary-color: #FFC107;
  --background-light: #f8f9fa;
  --text-light: #ffffff;
  --text-dark: #333333;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--background-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: var(--text-light);
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.title-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
}

.title-button:hover .logo-container {
  transform: scale(1.02);
}

.title-button:focus {
  outline: none;
}

.logo-container {
  transition: transform 0.2s ease;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  margin-right: 1rem;
  color: var(--secondary-color);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
}

nav {
  background-color: var(--primary-color);
  box-shadow: var(--shadow);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav button, .wallet-btn {
  background-color: var(--text-light);
  color: var(--primary-dark);
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

nav button:hover, .wallet-btn:hover {
  background-color: #e8f5e9;
  transform: translateY(-2px);
}

.wallet-btn {
  position: relative;
  padding-right: 2.5rem; 
  background-color: var(--secondary-color);
  color: var(--text-dark);
}

.wallet-btn:hover {
  background-color: #ffd54f;
}

.wallet-container {
  position: relative;
  display: flex;
  align-items: center;
  min-width: fit-content;
}

.status-indicator {
  position: absolute;
  right: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #f44336; 
  transition: all 0.3s ease;
}

.status-indicator.connected {
  background-color: #4CAF50; 
}

.status-text {
  color: white;
}

.wallet-address {
  display: none;
  margin-left: 0.5rem;
  font-family: monospace;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-container:hover .wallet-address {
    display: block; 
    max-width: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
    max-width: 300px;
}

@media (max-width: 768px) {
  .wallet-address {
    display: none !important; 
  }
  
  .wallet-container:hover .wallet-address {
    display: block !important; 
    top: auto;
    bottom: 100%;
    max-width: 200px;
  }
}

.wallet-error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #f44336;
    color: white;
    padding: 1rem 2rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.wallet-error.show {
    opacity: 1;
}

.wallet-btn.connected {
  background-color: #e8f5e9;
  color: var(--primary-dark);
}

main {
  flex: 1;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-section {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), 
              url('https://images.unsplash.com/photo-1605000797499-95a51c5269ae?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center;
  background-size: cover;
  border-radius: 10px;
  margin-bottom: 2rem;
}

.hero-section h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.hero-section p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.cta-button {
  background-color: var(--primary-light);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}

.cta-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.card-section {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 2rem auto;
  text-align: left;
  max-width: 1300px;
}

.card-section h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-section p {
  margin-bottom: 1.5rem;
  color: #555;
}

.styled-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--primary-dark);
}

.form-group label i {
  font-size: 1.1rem;
}

select, input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  transition: var(--transition);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.qty-btn:hover {
  background-color: var(--primary-dark);
}

.quantity-control input {
  width: 70px;
  text-align: center;
  font-weight: bold;
}

.token-estimate {
  background-color: #e8f5e9;
  padding: 1rem;
  border-radius: 5px;
  text-align: center;
}

.token-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-dark);
}

.submit-btn {
  background-color: var(--primary-light);
  color: white;
  padding: 1rem;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
}

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

footer {
  background-color: var(--primary-dark);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dashboard-container {
  padding: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

.user-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

#dashTransactions {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-type {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-type i {
  color: var(--primary-light);
  min-width: 20px;
  text-align: center;
}

.activity-description {
  font-weight: 500;
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-left: 1.75rem; 
}

.activity-date {
  color: #888;
}

.stat-tooltip {
  position: relative;
  cursor: pointer;
}

.stat-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  font-size: 0.9em;
  display: none;
  z-index: 10;
  width: max-content;
}

.stat-tooltip[data-tooltip]::after {
  content: attr(data-tooltip);
  white-space: pre; 
}

.stat-tooltip:hover::after {
  display: block;
}

.tx-link {
  color: var(--primary-light);
  text-decoration: none;
  font-family: monospace;
  background: rgba(76, 175, 80, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.tx-link:hover {
  color: var(--primary-dark);
  background: rgba(76, 175, 80, 0.2);
  text-decoration: none;
}

#badgeList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card-header {
  color: white;
  padding: 1.5rem;
  position: relative;
  color: var(--primary-dark);
}

.card-icon {
  font-size: 2rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
}

.card-level {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
}

.card-detail i {
  color: var(--secondary-color);
}

.card-button {
  width: 100%;
  background-color: var(--secondary-color);
  color: var(--text-dark);
  border: none;
  padding: 0.75rem;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.card-button:hover {
  background-color: #ffb300;
  transform: translateY(-2px);
}

.creation-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary-light);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 250px;
}

.creation-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

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

.creation-button i {
  font-size: 1.1rem;
}

.admin-only .creation-button {
  display: flex !important;
}

@media (max-width: 768px) {
  .creation-button {
    max-width: 100%;
    padding: 0.75rem;
  }
}

.contribute-modal {
    max-width: 500px;
    width: 90%;
}

.project-info {
    margin-bottom: 1.5rem;
}

.project-info h4 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.project-description {
    color: #555;
    line-height: 1.5;
}

.contribute-stats {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.stat-item i {
    color: var(--primary-light);
    width: 20px;
    text-align: center;
}

.stat-item strong {
    color: var(--primary-dark);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-control input {
    width: 60px;
    text-align: center;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-dark);
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--primary-dark);
}

.modal-body {
  padding: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.cancel-button {
  background: #f5f5f5;
  color: #333;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-button:hover {
  background: #eee;
}

.submit-button {
  background: var(--primary-light);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.submit-button:hover {
  background: var(--primary-dark);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: 5px;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1001;
}

.toast.show {
  opacity: 1;
}

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

.toast.error {
  background: #f44336;
}

.toast.info {
  background: #2196F3;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.toast-modal {
  background: white;
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 90%;
  animation: fadeIn 0.3s ease-in-out;
}

.toast-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast-modal-body {
  margin-top: 1em;
  margin-bottom: 1em;
}

.toast-modal-footer {
  text-align: right;
}

.toast-modal-button {
  background-color: #4CAF50;
  color: white;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.toast-modal-button:hover {
  background-color: #45a049;
}

.toast-modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  line-height: 1;
  cursor: pointer;
}

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

.toast-modal.success {
    border-color: var(--primary-light);
}

.toast-modal.error {
    border-color: #f44336;
}

.toast-modal.warning {
    border-color: #ff9800;
}

.toast-modal.info {
    border-color: #2196F3;
}

.toast-modal-content {
    padding: 1.5rem;
}

.toast-modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.toast-modal-header i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.toast-modal-header h3 {
    margin: 0;
    flex-grow: 1;
}

.toast-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.toast-modal-body p {
    margin: 0;
    line-height: 1.5;
}

.toast-modal-footer {
    margin-top: 1.5rem;
    text-align: right;
}

.toast-modal-button {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-modal-button:hover {
    background: var(--primary-dark);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 2rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--primary-dark);
  font-size: 1.1rem;
}

@media (max-width: 600px) {
  #badgeList {
    grid-template-columns: 1fr;
  }
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: monospace;
  background: rgba(0,0,0,0.05);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.wallet-info i {
  color: var(--primary-light);
}

.user-level {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.token-balance-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.balance-group h4 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.balance-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s ease;
}

.stat-card i {
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 0.5rem;
}

.stat-card h5 {
  color: var(--primary-dark);
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0;
}

.activity-section {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.activity-section h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.activity-amount {
  font-weight: 600;
}

.activity-positive {
  color: var(--primary-light);
}

.activity-date {
  font-size: 0.8rem;
  color: #888;
}

@media (max-width: 600px) {
  .token-balance-card {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
  }
  
  .nav-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .hero-section h2 {
    font-size: 1.8rem;
  }
  
  .card-section {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  nav button, .wallet-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .logo-icon {
    font-size: 2rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
}