/* ============================================
   TrustBridge Escrow - Main Stylesheet
   Dark Theme with Gold Accents + Animations
   ============================================ */

:root {
  --primary-color: #d4af37;
  --primary-dark: #b8941e;
  --bg-dark: #0f0f0f;
  --bg-darker: #1a1a1a;
  --bg-light: #2a2a2a;
  --text-light: #f5f5f5;
  --text-gray: #b0b0b0;
  --border-color: #404040;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --font-serif: Georgia, 'Playfair Display', serif;
  --font-sans: 'Inter', 'Roboto', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  line-height: 1.6;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.skeleton-loading {
  background: linear-gradient(90deg, var(--bg-light) 25%, var(--border-color) 50%, var(--bg-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 4px;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  margin-bottom: 1rem;
  animation: fadeIn 0.6s ease-out;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-gray);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideInLeft 0.6s ease-out;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.navbar-brand a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand a:hover {
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

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

.btn-danger {
  background-color: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background-color: darken(#ef4444, 10%);
}

.btn-success {
  background-color: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  background-color: darken(#10b981, 10%);
}

.btn-block {
  width: 100%;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s ease-out;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-gray);
  animation: pulse 2s infinite;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background-color: var(--bg-dark);
}

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

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-gray);
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ============================================
   Cards & Sections
   ============================================ */

.card {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  animation: fadeIn 0.6s ease-out;
}

.card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
  transform: translateY(-5px);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.section {
  padding: 2rem 0;
  animation: fadeIn 0.6s ease-out;
}

.section h2 {
  color: var(--text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary-color);
}

/* ============================================
   Tables
   ============================================ */

.table-responsive {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  animation: fadeIn 0.6s ease-out;
}

table th {
  background-color: var(--bg-darker);
  color: var(--primary-color);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

table tr {
  transition: background-color 0.3s ease;
}

table tr:hover {
  background-color: var(--bg-light);
}

table tr:last-child td {
  border-bottom: none;
}

/* ============================================
   Status Badges
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: scaleIn 0.3s ease-out;
}

.badge-primary {
  background-color: rgba(212, 175, 55, 0.2);
  color: var(--primary-color);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--info);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-pending {
  background-color: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-confirmed {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-completed {
  background-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-in-auth {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* ============================================
   Balance Display
   ============================================ */

.balance-card {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-color) 100%);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease-out;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.balance-row:last-child {
  border-bottom: none;
}

.balance-label {
  color: var(--text-gray);
  font-weight: 500;
}

.balance-amount {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
}

/* ============================================
   Grid Layouts
   ============================================ */

.grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   Stats Display
   ============================================ */

.stat-card {
  background-color: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  animation: fadeIn 0.6s ease-out;
}

.stat-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-gray);
  font-size: 0.95rem;
}

/* ============================================
   Messages (Success/Error/Info)
   ============================================ */

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  animation: slideInLeft 0.4s ease-out;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: var(--warning);
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--info);
  color: var(--info);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }

  .container {
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .navbar .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .navbar-menu {
    width: 100%;
  }

  table {
    font-size: 0.9rem;
  }

  table th,
  table td {
    padding: 0.75rem 0.5rem;
  }

  .card {
    padding: 1.5rem 1rem;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .balance-amount {
    font-size: 1.25rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .card {
    padding: 1rem;
    border-radius: 6px;
  }

  .section {
    padding: 1rem 0;
  }

  .balance-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }

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

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.65rem;
    font-size: 16px;
  }

  table {
    font-size: 0.8rem;
  }

  table th,
  table td {
    padding: 0.5rem;
  }

  .balance-card {
    padding: 1.5rem 1rem;
  }

  .navbar-brand a {
    font-size: 1.25rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .grid {
    gap: 1rem;
  }
}

@media (max-width: 320px) {
  .container {
    padding: 0 8px;
  }

  .card {
    padding: 0.75rem;
  }

  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
  h3 { font-size: 1rem; }

  .stat-number {
    font-size: 1.25rem;
  }

  .balance-amount {
    font-size: 1rem;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-gray);
}

.text-primary {
  color: var(--primary-color);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
  display: none;
}

.visible {
  display: block;
}

.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.rounded {
  border-radius: 8px;
}

.rounded-lg {
  border-radius: 12px;
}
