/* Custom styles for TRICKY Token App */

/* Default styles for account page */
body.account-page {
  background-color: #2C5530; /* Dark forest green */
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-image: linear-gradient(to bottom, #2C5530, #4DAA57);
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
}

/* Page specific styles */
body.home-page {
  background-color: #4DAA57;
  color: #fff;
  font-family: 'Uncial Antiqua', cursive;
  text-align: center;
}

body.groups-page, body.messaging-page {
  background-color: #2C5530; /* Dark forest green */
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-image: linear-gradient(to bottom, #2C5530, #4DAA57);
  background-attachment: fixed;
}

/* Card styling */
.card {
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

.card-header {
  font-weight: 600;
  padding: 0.75rem 1.25rem;
}

/* Forest theme card headers */
.card-header.bg-primary {
  background-color: #2C5530 !important; /* Dark forest green */
}

.card-header.bg-success {
  background-color: #4DAA57 !important; /* Medium forest green */
}

.card-header.bg-info {
  background-color: #6A8D73 !important; /* Sage green */
}

.card-header.bg-warning {
  background-color: #A4C3A2 !important; /* Light forest green */
  color: #2C5530 !important; /* Dark text for contrast */
}

.card-header.bg-secondary {
  background-color: #3A6B35 !important; /* Forest green */
}

.card-body {
  color: #333; /* Dark text for readability */
}

/* Button styling */
.btn {
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

/* Forest theme buttons */
.btn-primary {
  background-color: #2C5530;
  border-color: #2C5530;
}

.btn-success {
  background-color: #4DAA57;
  border-color: #4DAA57;
}

.btn-info {
  background-color: #6A8D73;
  border-color: #6A8D73;
}

.btn-warning {
  background-color: #A4C3A2;
  border-color: #A4C3A2;
  color: #2C5530;
}

.btn-outline-success {
  color: #4DAA57;
  border-color: #4DAA57;
}

.btn-outline-success:hover {
  background-color: #4DAA57;
  color: white;
}

.btn-outline-danger {
  color: #d9534f;
  border-color: #d9534f;
}

.btn-outline-danger:hover {
  background-color: #d9534f;
  color: white;
}

/* Network status badge */
#network-status {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  background-color: #3A6B35;
}

#network-status.bg-danger {
  background-color: #d9534f !important;
}

#network-status.bg-warning {
  background-color: #A4C3A2 !important;
  color: #2C5530 !important;
}

#network-status.bg-success {
  background-color: #4DAA57 !important;
}

/* Address display */
.text-break {
  word-break: break-all;
  font-family: monospace;
  background-color: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Transaction status */
.transaction-item {
  border-left: 4px solid transparent;
  padding-left: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.transaction-pending {
  border-left-color: #ffc107;
  background-color: rgba(255, 193, 7, 0.1);
}

.transaction-success {
  border-left-color: #28a745;
  background-color: rgba(40, 167, 69, 0.1);
}

.transaction-failed {
  border-left-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.1);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #007bff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

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

/* Alert styling */
.alert {
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.alert-warning {
  background-color: rgba(164, 195, 162, 0.2);
  color: #2C5530;
  border-left: 4px solid #A4C3A2;
}

.alert-danger {
  background-color: rgba(217, 83, 79, 0.1);
  color: #d9534f;
  border-left: 4px solid #d9534f;
}

.alert-success {
  background-color: rgba(77, 170, 87, 0.1);
  color: #4DAA57;
  border-left: 4px solid #4DAA57;
}

/* Table styling */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.table td, .table th {
  padding: 0.75rem;
  vertical-align: middle;
}

/* Address truncation */
.address-truncate {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

/* Tooltip styling */
.tooltip {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.8rem;
}

/* Cooldown timer */
#cooldown-timer {
  font-family: monospace;
  font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card {
    margin-bottom: 20px;
  }
  
  .address-truncate {
    max-width: 120px;
  }
  
  .story {
    font-size: 1.1rem;
    padding: 0 1rem;
  }
}

@media (max-width: 576px) {
  .address-truncate {
    max-width: 100px;
  }
  
  .table {
    font-size: 0.85rem;
  }
}

/* Navigation styles */
.navbar-tricky {
  background-color: rgba(0, 0, 0, 0.2);
  width: 100%;
}

.navbar-tricky .navbar-brand {
  font-weight: bold;
  color: white;
}

.navbar-tricky .nav-link {
  color: white !important;
}

.navbar-tricky .nav-link:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Story styles */
.story {
  max-width: 700px;
  margin: 2rem auto;
  font-size: 1.3rem;
  line-height: 1.7;
  text-align: center;
}

.story em {
  font-style: italic;
  opacity: 0.85;
}

.main-content {
  text-align: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Token info section */
.token-info {
  margin: 3rem auto;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 700px;
}

.btn-account {
  background-color: #fff;
  color: #4DAA57;
  font-weight: bold;
  padding: 0.75rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  border: none;
}

.btn-account:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  background-color: #f0f0f0;
}

/* Authentication styles */
.nav-user, .nav-guest {
  transition: all 0.3s ease;
}

.user-only, .guest-only {
  transition: all 0.3s ease;
}

/* Group list styles */
.list-group-item {
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.list-group-item:hover {
  background-color: rgba(77, 170, 87, 0.1);
  border-left-color: #4DAA57;
}

.list-group-item.active {
  background-color: #4DAA57 !important;
  border-color: #4DAA57 !important;
  color: white !important;
}

/* Group card styles */
.group-card {
  height: 100%;
  transition: all 0.3s ease;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Modal styles */
.modal-content {
  border-radius: 10px;
  border: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background-color: #2C5530;
  color: white;
  border-radius: 10px 10px 0 0;
}

.modal-body {
  color: #333; /* Dark text for readability on white background */
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Form styles */
.form-control:focus {
  border-color: #4DAA57;
  box-shadow: 0 0 0 0.25rem rgba(77, 170, 87, 0.25);
}

.form-select:focus {
  border-color: #4DAA57;
  box-shadow: 0 0 0 0.25rem rgba(77, 170, 87, 0.25);
}

/* Badge styles */
.badge {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.badge.bg-primary {
  background-color: #2C5530 !important;
}

/* Map styles */
.map-container {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* MapLibre GL specific styles */
.maplibregl-map {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.maplibregl-popup {
  max-width: 300px;
}

.maplibregl-popup-content {
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.maplibregl-popup-close-button {
  font-size: 16px;
  color: #333;
  padding: 5px;
}

.maplibregl-ctrl-group {
  border-radius: 4px;
  overflow: hidden;
}

/* Highlighted features */
.highlighted-feature {
  fill-color: #ff4500 !important;
  fill-opacity: 0.3 !important;
}

.highlighted-feature-outline {
  line-color: #ff4500 !important;
  line-width: 3 !important;
  line-opacity: 1 !important;
}

/* User menu styles */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-menu-button {
  background: none;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.user-menu-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.user-menu-button.active {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(0);
}

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

.user-menu-button img {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  z-index: 1000;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-menu-dropdown.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.2rem;
  color: #333;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.user-menu-item:hover {
  background-color: rgba(77, 170, 87, 0.1);
  color: #2C5530;
  padding-left: 1.5rem;
}

.user-menu-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.wallet-icon {
  color: #4DAA57;
  margin-left: 8px;
  font-size: 0.9rem;
}