/* ========================================
   URBAN SWING BUTTON STYLES
   Shared button styles for all pages (admin, student portal, public site)
   
   Sections:
   - Navigation Buttons (Desktop)
   - Action Buttons
   - Modal Buttons (TODO)
   - Form Buttons (TODO)
   ======================================== */

/* Note: colors.css should be imported before this file */
@import url('./design-tokens.css');

/* ========================================
   NAVIGATION BUTTONS (DESKTOP)
   Horizontal navigation menu styles
   ======================================== */

.nav-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: var(--space-xs);
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-white);
  font-size: 1rem;
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  display: inline-block;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-base);
  background: var(--header-overlay-light);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid transparent;
}

.nav-menu a i {
  margin-right: 6px;
}

.nav-menu a:hover {
  background: var(--header-overlay-bright);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-medium);
}

.nav-menu a.active {
  background: var(--header-overlay-strong);
  border-bottom-color: var(--pink-primary);
}

/* ========================================
   ACTION BUTTONS
   Primary call-to-action buttons used throughout the app
   (e.g., Register Student, Add Item, Create, etc.)
   ======================================== */

.btn-primary {
  background: var(--gradient-blue-purple);
  color: var(--text-white);
  border: none;
  padding: var(--space-xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--gradient-purple-pink);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--bg-purple-strong);
  color: var(--text-white) !important;
  text-decoration: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--gradient-blue-purple) !important;
}

.btn-primary-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
  white-space: nowrap;
}

.btn-cancel {
  background: var(--bg-error-light);
  color: var(--error);
  border: 1px solid var(--error);
  padding: var(--space-xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
}

.btn-cancel:hover {
  background: var(--error);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--bg-error-medium);
}

.btn-cancel:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: var(--bg-error-light) !important;
  color: var(--error) !important;
}

.btn-cancel-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
  white-space: nowrap;
}

.btn-delete {
  background: var(--error);
  color: var(--white);
  border: none;
  padding: var(--space-xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
}

.btn-delete:hover {
  background: var(--error-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--bg-error-strong);
}

.btn-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--error) !important;
}

.btn-delete-lg {
  padding: var(--space-xs) var(--space-md);
  font-size: 1rem;
}

/* ========================================
   ADDITIONAL BUTTON UTILITIES
   ======================================== */

/* Tertiary Button - Ghost */
.btn-tertiary {
  background: var(--hover-bg);
  color: var(--text-color);
  border: none;
  padding: var(--space-xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
}

.btn-tertiary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

/* Logout Button - Used in headers */
.btn-logout {
  background: var(--header-overlay-semi);
  color: var(--text-white);
  border: 1px solid var(--border-overlay-medium);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn-logout:hover {
  background: var(--header-overlay-strong);
  transform: translateY(-2px);
}

.btn-logout i {
  font-size: 1rem;
}

/* Back Button - Circular icon button */
.back-button,
.btn-back {
  background: var(--header-overlay-semi);
  color: var(--text-white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.back-button:hover,
.btn-back:hover {
  background: var(--header-overlay-strong);
  transform: scale(1.1);
  color: var(--text-white);
  text-decoration: none;
}

/* Success Button */
.btn-success {
  background: var(--success);
  color: var(--white);
  border: none;
  padding: var(--space-xs) var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 36px;
  box-sizing: border-box;
  line-height: 1;
}

.btn-success:hover {
  background: var(--success-lighter);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-success);
}

.btn-success:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: var(--success) !important;
}

/* Button Size Variants */
.btn-sm,
.btn-primary-sm,
.btn-cancel-sm,
.btn-delete-sm,
.btn-tertiary-sm,
.btn-success-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  height: 28px;
}

.btn-xl,
.btn-primary-xl,
.btn-cancel-xl,
.btn-delete-xl,
.btn-tertiary-xl,
.btn-success-xl {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
  height: 48px;
}

/* Full Width Button */
.btn-block {
  width: 100%;
  display: flex;
}

/* Button Groups */
.btn-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Loading State */
.btn-primary.loading,
.btn-cancel.loading,
.btn-delete.loading,
.btn-tertiary.loading,
.btn-success.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after,
.btn-cancel.loading::after,
.btn-delete.loading::after,
.btn-tertiary.loading::after,
.btn-success.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: button-spinner 0.6s linear infinite;
}

.btn-primary.loading::after {
  border-color: white;
  border-top-color: transparent;
}

.btn-cancel.loading::after {
  border-color: var(--error);
  border-top-color: transparent;
}

.btn-delete.loading::after {
  border-color: white;
  border-top-color: transparent;
}

@keyframes button-spinner {
  to { transform: rotate(360deg); }
}

/* ========================================
   ICON BUTTONS
   Small buttons with just icons, used in tables and action columns
   ======================================== */

.btn-icon {
  padding: var(--space-xs) 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
  transform: translateY(-2px);
}

.btn-icon i {
  font-size: 0.9rem;
}

/* Icon Button Variants */
.btn-icon.has-notes {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
}

.btn-icon.has-notes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--bg-purple-strong);
}

.btn-icon.btn-delete {
  background: var(--bg-error-light);
  color: var(--error);
  border-color: var(--error);
}

.btn-icon.btn-delete:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.btn-icon.btn-restore {
  color: var(--success);
  border-color: var(--success);
}

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

.btn-icon.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-icon.btn-disabled:hover {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: none;
}

.btn-icon.btn-invoice {
  color: var(--purple-primary);
  border-color: var(--purple-primary);
}

.btn-icon.btn-invoice:hover {
  background: var(--purple-primary);
  color: white;
}

.btn-icon.btn-invoice.invoiced {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
}

.btn-icon.btn-invoice.invoiced:hover {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--bg-purple-strong);
}

.btn-icon.btn-complete {
  color: var(--success);
  border-color: var(--success);
}

.btn-icon.btn-complete:hover {
  background: var(--success);
  color: white;
}

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

/* ========================================
   PAGINATION BUTTONS
   Navigation and page number buttons for tables
   ======================================== */

.pagination-btn {
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
}

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

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-number {
  padding: var(--space-xs) 12px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 40px;
}

.pagination-number:hover {
  background: var(--purple-primary);
  color: white;
  border-color: var(--purple-primary);
}

.pagination-number.active {
  background: var(--gradient-blue-purple);
  color: white;
  border-color: transparent;
}

.pagination-ellipsis {
  padding: 0 8px;
  color: var(--text-primary);
  opacity: 0.5;
}

/* Mobile-specific styles for action buttons */
@media (max-width: 768px) {
  /* On mobile, action buttons can be full-width within their container */
  .btn-primary.full-width-mobile {
    width: 100%;
    justify-content: center;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group > * {
    width: 100%;
  }
}
