/* Main color palette */
:root {
  --primary-color: #4a6cf7;
  --primary-dark: #3955d1;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --body-bg: #f5f7ff;
  --card-shadow: 0 4px 12px rgba(31, 45, 61, 0.1);
  --header-height: 70px;
  --mobile-header-height: 60px;
}

/* Global styles */
body {
  font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--body-bg);
  color: #333;
  padding-top: var(--header-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
}

/* Navbar styling */
.navbar-dark.bg-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: var(--header-height);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

/* Navbar toggler */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

/* Dropdown styling */
.dropdown-menu {
  border: none;
  box-shadow: var(--card-shadow);
  border-radius: 0.5rem;
}

.dropdown-item {
  padding: 0.7rem 1.5rem;
  font-weight: 500;
}

.dropdown-item:hover {
  background-color: rgba(74, 108, 247, 0.1);
}

.dropdown-item.text-danger:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Admin dropdown hover behavior */
@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-menu.show-on-hover {
    display: block;
    margin-top: 0;
    animation: fadeIn 0.2s ease-in-out;
  }
  
  .nav-item.dropdown .dropdown-menu.show-on-hover {
    margin-top: 0;
    border-top: 3px solid var(--primary-color);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

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

/* Dropdown fixes for mobile */
@media (max-width: 991px) {
  .navbar-dark.bg-primary {
    height: auto;
    min-height: var(--mobile-header-height);
  }
  
  body {
    padding-top: var(--mobile-header-height);
  }
  
  .navbar-collapse {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 0 0 1rem 1rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - var(--mobile-header-height));
    overflow-y: auto;
  }
  
  .navbar-nav .nav-link {
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
  }
  
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
  }
  
  .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: none;
  }
  
  .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  .dropdown-item {
    color: #fff;
  }
  
  .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
  }
  
  .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .d-flex.navbar-nav {
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
  }
  
  /* Ensure dropdowns work in mobile */
  .navbar-nav .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  /* Wallet info in mobile */
  .wallet-address {
    max-width: 120px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Card styling */
.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 20px rgba(31, 45, 61, 0.15);
  transform: translateY(-5px);
}

.card-header {
  background-color: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.2rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Status cards */
.bg-info, .bg-success, .bg-warning, .bg-danger {
  color: white;
}

.bg-info {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
}

.bg-success {
  background: linear-gradient(135deg, #28a745, #1e7e34) !important;
}

.bg-warning {
  background: linear-gradient(135deg, #ffc107, #d39e00) !important;
  color: #333;
}

.bg-danger {
  background: linear-gradient(135deg, #dc3545, #bd2130) !important;
}

/* Dashboard stats */
.stat-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  color: white;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0));
  z-index: -1;
}

.stat-card i.stat-icon {
  position: absolute;
  bottom: -15px;
  right: 10px;
  font-size: 5rem;
  opacity: 0.2;
}

.display-4, .display-6 {
  font-weight: 700;
}

/* Buttons styling */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 4px 10px rgba(74, 108, 247, 0.3);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color), #1e7e34);
  border: none;
}

.btn-success:hover {
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #bd2130);
  border: none;
}

.btn-danger:hover {
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color), #d39e00);
  border: none;
  color: #212529;
}

.btn-warning:hover {
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
  transform: translateY(-2px);
}

.btn-light {
  background: white;
  border: 1px solid #e9ecef;
}

.btn-light:hover {
  background: #f8f9fa;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Table styling */
.table {
  margin-bottom: 0;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  border-top: none;
  vertical-align: middle;
}

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

/* Badge styling */
.badge {
  padding: 0.5em 0.8em;
  font-weight: 500;
  border-radius: 0.375rem;
}

.badge.bg-success {
  background: #28a745 !important;
}

.badge.bg-danger {
  background: #dc3545 !important;
}

.badge.bg-warning {
  background: #ffc107 !important;
  color: #212529;
}

.badge.bg-info {
  background: #17a2b8 !important;
}

.badge.bg-secondary {
  background: #6c757d !important;
}

/* Form styling */
.form-control {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid #dee2e6;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input-group-text {
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: #f8f9fa;
}

/* Alert styling */
.alert {
  border: none;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #155724;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: #721c24;
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  color: #0c5460;
}

/* Footer styling */
footer {
  padding: 2rem 0;
  margin-top: 3rem;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .card {
    margin-bottom: 1.5rem;
  }
  
  .table-responsive {
    margin-bottom: 0;
  }
}

/* Blockchain transaction sections */
#blockchain-section, #transaction-hash-section, #processing, #success, #error {
  border-radius: 0.75rem;
  margin-top: 1.5rem;
}

#debug-info {
  border-radius: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

/* Overdue loan highlighting */
tr.overdue-row {
  background-color: rgba(220, 53, 69, 0.05) !important;
}

tr.overdue-row:hover {
  background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Data visualizations */
.chart-container {
  height: 300px;
  margin-bottom: 1.5rem;
}

/* Loading spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Loan information labels */
.loan-info-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.loan-info-value {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Custom wallet address display */
.wallet-address {
  font-family: 'Courier New', monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* Animation for status changes */
@keyframes highlight {
  0% {
    background-color: rgba(255, 255, 0, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

.highlight {
  animation: highlight 2s;
} 