/* ============================================
   RESPONSIVE DESIGN - Mobile First Approach
   ============================================ */

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 576px) {
  html {
    font-size: 15px;
  }
}

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

@media (min-width: 992px) {
  html {
    font-size: 16.5px;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 17px;
  }
}

/* ============================================
   MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 576px) {
  html {
    font-size: 13px;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 12px;
  }
}

/* ============================================
   FOCUS STATES & ACCESSIBILITY
   ============================================ */

.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;
  outline: none;
}

/* ============================================
   LAYOUT & STRUCTURE
   ============================================ */

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   NAVBAR RESPONSIVENESS
   ============================================ */

.navbar {
  padding: 0.75rem 0;
}

@media (max-width: 991px) {
  .navbar-collapse {
    margin-top: 1rem;
  }
  
  .navbar-nav {
    gap: 0.5rem;
  }
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  min-height: 44px;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 0;
  }

  .navbar-brand {
    font-size: 1.1rem;
  }

  .nav-link {
    padding: 0.6rem 0.75rem !important;
    font-size: 0.95rem;
    min-height: 44px;
  }

  .navbar-nav {
    gap: 0.3rem;
  }

  .dropdown-menu {
    font-size: 0.9rem;
  }

  .dropdown-item {
    padding: 0.5rem 1rem;
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem;
    letter-spacing: 0.5px;
  }

  .nav-link {
    padding: 0.5rem 0.5rem !important;
    font-size: 0.9rem;
  }

  .navbar-toggler {
    padding: 0.25rem 0.5rem;
  }

  .navbar-toggler-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .dropdown-menu {
    font-size: 0.85rem;
  }

  .dropdown-item {
    padding: 0.4rem 0.75rem;
    min-height: 38px;
  }
}

@media (max-width: 400px) {
  .navbar-brand {
    font-size: 0.9rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.4rem !important;
  }
}

/* ============================================
   CARD STYLING
   ============================================ */

.card {
  border-radius: 15px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

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

@media (max-width: 576px) {
  .card {
    border-radius: 10px;
    margin-bottom: 1rem;
  }
}

/* ============================================
   BUTTON STYLING
   ============================================ */

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-primary {
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 140, 251, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-outline-primary {
  min-height: 44px;
}

@media (max-width: 768px) {
  .btn {
    min-height: 42px;
    font-size: 0.95rem;
  }

  .btn-sm {
    min-height: 36px;
    font-size: 0.8rem;
  }

  .btn-lg {
    min-height: 48px;
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-height: 40px;
  }
  
  .btn-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    min-height: 34px;
  }

  .btn-lg {
    min-height: 44px;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 400px) {
  .btn {
    font-size: 0.85rem;
    min-height: 38px;
    padding: 0.4rem 0.6rem;
  }

  .btn-sm {
    min-height: 32px;
    font-size: 0.75rem;
  }
}

/* ============================================
   TABLE RESPONSIVENESS
   ============================================ */

.table-responsive {
  border-radius: 15px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.9rem;
  }
  
  .table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .table tbody td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 576px) {
  .table {
    font-size: 0.85rem;
  }
  
  .table thead th {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .table tbody td {
    padding: 0.5rem 0.25rem;
  }
  
  .ps-4 {
    padding-left: 0.5rem !important;
  }
  
  .pe-4 {
    padding-right: 0.5rem !important;
  }
}

/* ============================================
   BADGE STYLING
   ============================================ */

.badge {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .badge {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* ============================================
   CONTAINER & SPACING
   ============================================ */

.container-fluid {
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-select,
.form-control {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  min-height: 44px;
}

.form-select:focus,
.form-control:focus {
  border-color: #258cfb;
  box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.25);
}

.form-check-input {
  min-width: 20px;
  min-height: 20px;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

@media (max-width: 768px) {
  .form-select,
  .form-control {
    font-size: 1rem;
    min-height: 42px;
  }

  .form-check-input {
    min-width: 18px;
    min-height: 18px;
  }
}

@media (max-width: 576px) {
  .form-select,
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 40px;
  }

  .form-check-input {
    min-width: 18px;
    min-height: 18px;
  }
}

@media (max-width: 400px) {
  .form-select,
  .form-control {
    font-size: 16px;
    min-height: 38px;
  }
}

/* ============================================
   FOOTER RESPONSIVENESS
   ============================================ */

footer {
  margin-top: auto;
  padding: 2rem 0;
}

footer .container-fluid {
  max-width: 100%;
}

footer h5 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

footer p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

footer a {
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

footer a:hover {
  color: #5fd3d0 !important;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer hr {
  margin: 1.5rem 0;
}

@media (max-width: 1024px) {
  footer {
    padding: 1.75rem 0;
  }

  footer h5 {
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
  }

  footer p {
    font-size: 0.9rem;
  }

  footer a {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  footer {
    padding: 1.5rem 0;
  }

  footer .col-12 {
    margin-bottom: 1.25rem;
  }

  footer .col-md-4 {
    margin-bottom: 1.25rem;
  }

  footer h5 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
  }

  footer p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  footer a {
    font-size: 0.9rem;
    min-height: 40px;
  }

  footer ul {
    padding-left: 0;
  }

  footer li {
    margin-bottom: 0.4rem;
  }

  footer hr {
    margin: 1.25rem 0;
  }
}

@media (max-width: 576px) {
  footer {
    padding: 1rem 0;
  }

  footer .col-12 {
    margin-bottom: 1rem;
  }

  footer h5 {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }

  footer p {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }

  footer a {
    font-size: 0.85rem;
    min-height: 38px;
  }

  footer ul {
    padding-left: 0;
  }

  footer li {
    margin-bottom: 0.35rem;
  }

  footer hr {
    margin: 1rem 0;
  }

  footer .text-center {
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  footer {
    padding: 0.75rem 0;
  }

  footer h5 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  footer p {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
  }

  footer a {
    font-size: 0.8rem;
    min-height: 36px;
  }

  footer li {
    margin-bottom: 0.3rem;
  }

  footer hr {
    margin: 0.75rem 0;
  }

  footer .text-center {
    font-size: 0.75rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* Touch-friendly spacing */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 768px) {
  .gap-1 {
    gap: 0.3rem !important;
  }
  
  .gap-2 {
    gap: 0.5rem !important;
  }

  .gap-3 {
    gap: 0.75rem !important;
  }

  .gap-4 {
    gap: 1rem !important;
  }
}

@media (max-width: 576px) {
  .gap-1 {
    gap: 0.25rem !important;
  }
  
  .gap-2 {
    gap: 0.4rem !important;
  }

  .gap-3 {
    gap: 0.6rem !important;
  }

  .gap-4 {
    gap: 0.8rem !important;
  }

  .p-3 {
    padding: 0.75rem !important;
  }

  .p-4 {
    padding: 1rem !important;
  }

  .px-3 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  body {
    margin-bottom: 0;
  }
  
  nav,
  footer {
    display: none;
  }
  
  .btn,
  .form-select {
    display: none;
  }
}

/* ============================================
   ANIMATION & TRANSITIONS
   ============================================ */

* {
  transition: background-color 0.2s ease, color 0.2s ease;
}

button,
a {
  transition: all 0.3s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid #258cfb;
  outline-offset: 2px;
}

/* Ensure sufficient color contrast */
.text-muted {
  color: #6c757d !important;
}

/* Touch-friendly link targets */
a[href],
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 576px) {
  a[href],
  button,
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"] {
    min-height: 40px;
  }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }
  
  .card {
    background-color: #2a2a2a;
    color: #e0e0e0;
  }
  
  .table {
    color: #e0e0e0;
  }
}
/* ??? ?????? ?? ??????? */
