/**
 * Main CSS for WireGuard Easy Web Project
 * Base styles and common components
 */

/* =============================================================================
   Global Styles
   ============================================================================= */

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.main-content {
  min-height: calc(100vh - 60px);
}

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

.navbar-brand {
  font-weight: 700;
}

.navbar-dark .navbar-nav .navbar-text {
  color: rgba(255, 255, 255, 0.75);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.15s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}

/* =============================================================================
   Cards
   ============================================================================= */

.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition:
    box-shadow 0.15s ease-in-out,
    transform 0.15s ease-in-out;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 600;
}

.card-header.bg-success {
  background-color: #28a745 !important;
  border-color: #28a745;
}

/* =============================================================================
   Client Cards
   ============================================================================= */

.client-card {
  transition: transform 0.2s ease-in-out;
  cursor: default;
}

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

.client-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #495057;
}

.client-card .card-text {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.client-card .btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* =============================================================================
   Status Indicators
   ============================================================================= */

.status-connected {
  color: #28a745;
}

.status-disconnected {
  color: #6c757d;
}

.badge {
  font-size: 0.75em;
  font-weight: 500;
}

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

.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
}

.btn-success:hover {
  background-color: #1e7e34;
  border-color: #1c7430;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  border-color: #007bff;
}

.btn-outline-success:hover {
  background-color: #28a745;
  border-color: #28a745;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
}

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

.form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group-text {
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.375rem 0 0 0.375rem;
}

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

/* =============================================================================
   Modals
   ============================================================================= */

.modal-content {
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

.modal-title {
  font-weight: 600;
  color: #495057;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
}

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

.table {
  margin-bottom: 0;
}

.table thead th {
  border-top: none;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

.table td {
  vertical-align: middle;
}

.table-responsive {
  border-radius: 0.375rem;
}

/* =============================================================================
   Alerts
   ============================================================================= */

.alert {
  border: none;
  border-radius: 0.5rem;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

/* Dashboard alerts (positioned) */
.dashboard-alert {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* =============================================================================
   Loading States
   ============================================================================= */

.spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* =============================================================================
   Utilities
   ============================================================================= */

.text-muted {
  color: #6c757d !important;
}

.bg-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* =============================================================================
   Responsive Adjustments
   ============================================================================= */

@media (max-width: 768px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .client-card {
    margin-bottom: 1rem;
  }

  .btn-group-sm {
    display: flex;
    justify-content: space-between;
  }

  .modal-dialog {
    margin: 1rem;
  }

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

  .dashboard-alert {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .card-body {
    padding: 1rem;
  }

  .btn-group-sm .btn {
    padding: 0.375rem 0.5rem;
    margin: 0.125rem;
  }
}

/* =============================================================================
   Animation and Transitions
   ============================================================================= */

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
  .navbar,
  .modal,
  .btn,
  .alert {
    display: none !important;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
  }

  body {
    background: white !important;
  }
}
