/* Atlantis Trust Banking System - Consistent Component Library */
/* This file provides consistent styling across all roles */

/* === COLOR SYSTEM === */
:root {
  /* Primary Brand Colors */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  /* Status Colors */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic Tokens */
  --background: #ffffff;
  --surface: var(--gray-50);
  --border: var(--gray-200);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
}

/* === TYPOGRAPHY === */
.text-heading-1 {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.text-heading-2 {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.text-heading-3 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.text-body {
  font-size: 1rem;
  line-height: 1.5rem;
  color: var(--text-primary);
}

.text-body-small {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-secondary);
}

.text-caption {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--text-muted);
}

/* === LAYOUT COMPONENTS === */
.app-container {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card {
  background: var(--background);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* === HEADER COMPONENT === */
.app-header {
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

.header-logo {
  flex-shrink: 0;
}

.logo {
  height: 2.5rem;
  width: auto;
  max-width: 120px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
  padding: 0.5rem 0;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-600);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-600);
  transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .user-info {
    display: none;
  }
}

/* === BUTTON COMPONENTS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
  gap: 0.5rem;
}

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-md {
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

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

.btn-success:hover:not(:disabled) {
  background: var(--success-700);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--error-700);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-600);
  color: var(--primary-600);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-600);
  color: white;
}

/* === FORM COMPONENTS === */
.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--background);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
  border-color: var(--error-500);
}

.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
  color: var(--error-600);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-success {
  color: var(--success-600);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === MODAL COMPONENTS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--background);
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
}

.modal-sm { width: 24rem; }
.modal-md { width: 32rem; }
.modal-lg { width: 48rem; }

.modal-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* === STATUS COMPONENTS === */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 0.25rem;
}

.status-success {
  background: var(--success-100);
  color: var(--success-700);
}

.status-error {
  background: var(--error-100);
  color: var(--error-700);
}

.status-warning {
  background: var(--warning-100);
  color: var(--warning-700);
}

.status-info {
  background: var(--primary-100);
  color: var(--primary-700);
}

/* === LOADING STATES === */
.loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--primary-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
}

/* === RESPONSIVE BEHAVIOR === */
@media (max-width: 1024px) {
  .header-content {
    gap: 1rem;
  }
  
  .nav-menu {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 0 0.75rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .nav-menu {
    display: none;
  }
  
  .modal {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .header-content {
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .text-heading-1 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  .text-heading-2 {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  .btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
  }
  
  .nav-menu {
    display: none;
  }
  
  .user-menu {
    gap: 0.5rem;
  }
  
  .logo {
    height: 2rem;
  }
  
  .user-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
}

/* === MOBILE NAVIGATION === */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: block;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
  }
  
  .mobile-nav-toggle {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
  }
  
  .mobile-nav-menu {
    width: 100%;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    display: none;
    margin-top: 0.5rem;
    border-radius: 0.375rem;
  }
  
  .mobile-nav-menu.active {
    display: block;
    animation: slideDown 0.2s ease;
  }
  
  .mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
  }
  
  .mobile-nav-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}