/* Mobile-first responsive design */
html {
  font-size: 14px;
  height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

/* Focus styles */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Mobile-optimized buttons */
.btn {
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
}

/* Mobile-friendly cards */
.card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-radius: 16px 16px 0 0 !important;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Form controls for mobile */
.form-control {
  border-radius: 10px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-control-lg {
  padding: 1rem 1.25rem;
  font-size: 1.2rem;
  border-radius: 12px;
}

/* Drawing canvas responsive */
#drawingCanvas {
  border-radius: 12px;
  border: 3px solid #dee2e6;
  background: white;
  touch-action: none;
  max-width: 100%;
  height: auto;
}

/* Mobile navigation */
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d6efd !important;
}

/* Progress bars */
.progress {
  border-radius: 10px;
  height: 8px;
}

/* Alert styling */
.alert {
  border-radius: 12px;
  border: none;
  font-weight: 500;
}

/* Badge styling */
.badge {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Mobile-specific utilities */
@media (max-width: 767.98px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .display-3 {
    font-size: 2.5rem;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .btn-group {
    flex-wrap: wrap;
  }
  
  .btn-group .btn {
    margin-bottom: 0.5rem;
  }
  
  /* Stack drawing tools vertically on mobile */
  .card-footer .row {
    flex-direction: column;
  }
  
  .card-footer .col-md-8,
  .card-footer .col-md-4 {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1rem;
    text-align: center !important;
  }
  
  /* Make canvas fill width on mobile */
  #drawingCanvas {
    width: 100% !important;
    height: auto !important;
    max-height: 60vh;
  }
  
  /* Larger touch targets */
  .btn {
    min-height: 48px;
    min-width: 48px;
  }
  
  .form-control {
    min-height: 48px;
  }
  
  /* List group mobile optimization */
  .list-group-item {
    padding: 1rem;
    border-radius: 10px !important;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef !important;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Large screen adjustments */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Loading states */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Improved shadows and hover effects */
.card:hover {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Animation classes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Focus indicators for accessibility */
.btn:focus,
.form-control:focus,
button:focus {
  outline: 3px solid rgba(13, 110, 253, 0.5);
  outline-offset: 2px;
}