/* ==============================
   MODERN BLACK THEME DESIGN SYSTEM
   ============================== */

/* --- Critical Overrides for Legacy Styles --- */
/* These rules override conflicting styles from styles.css to ensure 
   the modern UI system takes precedence */

/* Override old modal backdrop and visibility */
.modal {
  background: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(8px) !important;
}

/* Ensure hidden modals are properly hidden */
.modal.hidden,
.modal.modal-hidden {
  display: none !important;
}

/* Ensure visible modals are properly displayed */
.modal.modal-visible {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Override old modal content styling */
.modal .modal-content {
  background: var(--bg-modal) !important;
  color: var(--text-primary) !important;
}

/* Override old button styles for modern buttons */
.modal .btn {
  font-family: var(--font-family) !important;
  border-radius: var(--border-radius) !important;
  transition: all var(--transition-fast) !important;
}

/* Override text colors in modals */
.modal,
.modal * {
  color: var(--text-primary);
}

.modal label,
.modal .modal-question label {
  color: var(--text-secondary) !important;
}

/* Hide burger menu when modal is visible */
.modal.modal-visible~.side-menu-burger,
body:has(.modal.modal-visible) .side-menu-burger {
  display: none !important;
}

/* Override input and select styles in modals */
.modal input,
.modal select,
.modal textarea {
  background: var(--modal-element-bg) !important;
  border: 2px solid var(--modal-element-bg) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius) !important;
  font-family: var(--font-family) !important;
  padding: 12px 16px !important;
  transition: all var(--transition-fast) !important;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  background: var(--modal-element-bg-hover) !important;
  border-color: var(--modal-element-bg-hover) !important;
  outline: none !important;
}

.modal input:hover,
.modal select:hover,
.modal textarea:hover {
  background: var(--modal-element-bg-hover) !important;
  border-color: var(--modal-element-bg-hover) !important;
}

/* Override placeholder text */
.modal input::placeholder,
.modal textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Override button colors for dark theme */
.modal .btn-primary {
  background: var(--bg-accent) !important;
  border-color: var(--bg-accent) !important;
  color: var(--text-on-accent) !important;
}

.modal .btn-primary:hover {
  background: var(--bg-accent-hover) !important;
  border-color: var(--bg-accent-hover) !important;
}

.modal .btn-success {
  background: var(--bg-success) !important;
  color: white !important;
}

.modal .btn-danger {
  background: var(--bg-danger) !important;
  border-color: var(--bg-danger) !important;
  color: white !important;
}

.modal .btn-secondary {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-primary) !important;
  color: var(--text-secondary) !important;
}

/* --- Font Face Declarations --- */


/* --- CSS Variables for Consistent Theming --- */
:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  /* Pure black background */
  --bg-secondary: #1a1a1a;
  /* Dark grey background - unified modal background */
  --bg-tertiary: #2a2a2a;
  /* Lighter dark background */
  --bg-modal: #1a1a1a;
  /* Modal background - unified */
  --bg-card: #242424;
  /* Card/content background */
  --bg-input: #1e1e1e;
  /* Input field background */
  --bg-button: #2d2d2d;
  /* Button background */
  --bg-button-hover: #3a3a3a;
  /* Button hover background */
  --bg-accent: #D9D9D950;
  /* Accent blue */
  --bg-accent-hover: #03a3b1;
  /* Accent blue hover */
  --bg-success: #4a9eff;
  /* Success green */
  --bg-danger: #ee2e24;
  /* Error red */
  --bg-warning: #fdb714;
  /* Warning yellow */

  /* Text Colors - Unified with EEFDF9 */
  --text-primary: #EEFDF9;
  /* Primary text - unified */
  --text-secondary: #EEFDF9;
  /* Secondary text - unified */
  --text-muted: #9ca3af;
  /* Muted grey text */
  --text-accent: #4a9eff;
  /* Accent text color */
  --text-on-accent: #ffffff;
  /* Text on accent backgrounds */

  /* Borders */
  --border-primary: #3a3a3a;
  /* Primary border color */
  --border-secondary: #2a2a2a;
  /* Secondary border color */
  --border-accent: #03a3b1;
  /* Accent border color */
  --border-radius: 12px;
  /* Standard border radius */
  --border-radius-sm: 8px;
  /* Small border radius */
  --border-radius-lg: 16px;
  /* Large border radius */

  /* Modal specific colors - Unified with EEFDF9 */
  --modal-text-white: #EEFDF9;
  --modal-element-bg: #EEFDF910;
  --modal-element-bg-equipment: #EEFDF970;

  /* 10% opacity for unselected */
  --modal-element-bg-hover: #EEFDF950;
  --modal-element-bg-hover-equipment: #EEFDF950;
  /* 20% opacity for selected/hover */

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 12px 35px rgba(0, 0, 0, 0.35);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Typography */
  --font-family: "Inter", sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 16px;
  --font-size-md: 16px;
  --font-size-lg: 24px;
  --font-size-xl: 24px;
  --font-size-2xl: 24px;
  --font-size-3xl: 36px;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;

  /* Z-index layers */
  --z-modal: 10001;
  --z-modal-backdrop: 10000;
  --z-dropdown: 500;
  --z-header: 100;
  --z-base: 1;
}

/* ==============================
   MODAL SYSTEM REDESIGN
   ============================== */

/* Modal Backdrop */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.modal-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

/* Modal Content Container */


.modal-content {
  background-color: var(--background-color, #1a1a1a);
  border-radius: var(--border-radius-lg, 12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

/* Small modal variant for specific cases */
.modal-content.small-modal {
  width: 90%;
  height: auto;
  max-width: 600px;
  max-height: 90vh;
  border-radius: 28px;
}

.modal.modal-visible .modal-content {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
  padding: var(--spacing-xl) var(--spacing-xl) 0;
  margin-bottom: var(--spacing-lg);
}

.modal-header h2,
.modal h2 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 var(--spacing-xl) var(--spacing-lg) 0;
  text-align: center;
}

/* Modal Body */
.modal-body {
  padding: 0 var(--spacing-xl) var(--spacing-xl);
}

/* Modal Close Button */
.modal-close-btn {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--bg-button-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}


/* Preference modal styles moved to preferences-modal.css */

/* Location modal specific styles moved to preferences-modal.css */

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

/* Form hints */
.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--spacing-sm);
  display: block;
  line-height: var(--line-height-normal);
}

/* Labels */
.modal label,
.modal-question label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

/* Text Inputs & Textareas */
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="email"],
.modal input[type="password"],
.modal textarea,
.modal select {
  width: 100%;
  padding: var(--spacing-md);
  background: var(--bg-input);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.modal textarea {
  resize: vertical;
  min-height: 80px;
}

/* ==============================
   BUTTON SYSTEM
   ============================== */

/* Button icons */
.btn-icon {
  width: 16px;
  height: 16px;
  margin-left: var(--spacing-sm);
  filter: brightness(0) invert(1);
  /* Makes icon white */
  transition: all var(--transition-fast);
}

.btn-success .btn-icon {
  filter: brightness(0) invert(1);
  /* White icon for success buttons */
}

.btn-primary .btn-icon {
  filter: brightness(0) invert(1);
  /* White icon for primary buttons */
}

.btn-secondary .btn-icon {
  filter: brightness(0.8);
  /* Slightly dimmed for secondary buttons */
}

.btn:hover .btn-icon {
  transform: translateX(2px);
  /* Subtle animation on hover */
}

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
  gap: var(--spacing-sm);
}

/* Button Variants */
.btn-primary {
  background: var(--bg-accent);
  color: var(--text-on-accent);
  border-color: var(--bg-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--bg-accent-hover);
  border-color: var(--bg-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--bg-success);
  color: var(--text-on-accent);
  border-color: var(--bg-success);
  font-weight: bold;
  font-size: large;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--bg-danger);
  color: var(--text-on-accent);
  border-color: var(--bg-danger);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-button);
  color: var(--text-secondary);
  border-color: var(--border-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-button-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-button);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* Button States */
.btn:disabled,
.btn.disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border-secondary);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ==============================
   SPECIFIC COMPONENT OVERRIDES
   ============================== */

/* Generate Workout Button */
#generate-workout-btn {
  font-size: var(--font-size-lg) !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: var(--spacing-md) var(--spacing-xl) !important;
}

/* Location components, equipment selector, weight selection, and gym dropdown
   styles have been consolidated into preferences-modal.css */

/* Modal Sizes */
.modal-large {
  max-width: 800px !important;
  width: 95% !important;
}

.modal-standard {
  max-width: 600px !important;
  width: 90% !important;
}

.modal-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* Desktop: Center content using flexbox */
@media (min-width: 768px) {
  .modal-fullscreen {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .modal-fullscreen .modal-header,
  .modal-fullscreen .modal-body,
  .modal-fullscreen .modal-actions {
    width: 100%;
    max-width: 800px;
  }

  .modal-fullscreen .modal-body {
    flex: 0 1 auto;
    overflow-y: auto;
    max-height: 80vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 1024px) {

  .modal-fullscreen .modal-header,
  .modal-fullscreen .modal-body,
  .modal-fullscreen .modal-actions {
    max-width: 1000px;
  }
}

@media (min-width: 1440px) {

  .modal-fullscreen .modal-header,
  .modal-fullscreen .modal-body,
  .modal-fullscreen .modal-actions {
    max-width: 1200px;
  }
}

/* Desktop: Style modal-actions when inside modal-body */
@media (min-width: 768px) {
  .modal-fullscreen .modal-body .modal-actions {
    border-top: none;
    margin-top: var(--spacing-2xl);
    padding-top: 0;
    padding-bottom: var(--spacing-xl);
  }
}

/* Form Input Styling */
.form-input {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--font-size-md);
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ==============================
   CHECKBOX & RADIO COMPONENTS
   ============================== */

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
  font-weight: 400;
  margin-bottom: 0;
}

.checkbox-group label:hover {
  background: var(--bg-button);
  border-color: var(--border-accent);
}

.checkbox-group label:has(input:checked) {
  background: var(--bg-accent);
  border-color: var(--bg-accent);
  color: var(--text-on-accent);
}

.checkbox-group input[type="checkbox"] {
  margin-right: var(--spacing-sm);
  accent-color: var(--bg-accent);
}


/* ==============================
   ERROR MESSAGING
   ============================== */

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--border-radius-sm);
  color: #fca5a5;
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
  font-size: var(--font-size-sm);
  text-align: center;
  display: none;
}

.error-message.visible {
  display: block;
  animation: slideInError 0.3s ease;
}

@keyframes slideInError {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================
   MODAL ACTIONS
   ============================== */

.modal-actions,
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-secondary);
}

/* ==============================
   MODAL SCROLLBAR STYLING
   ============================== */

/* Apply minimalistic scrollbar styling to all modal content */
.modal-content {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-modal);
}

.modal-content::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--bg-modal);
  border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
  border: 1px solid var(--bg-modal);
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-primary);
}

/* Apply same styling to any scrollable elements within modals */
.modal .equipment-grid,
.modal .equipment-list,
.modal .horizontal-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-modal);
}

.modal .equipment-grid::-webkit-scrollbar,
.modal .equipment-list::-webkit-scrollbar,
.modal .horizontal-scroll-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.modal .equipment-grid::-webkit-scrollbar-track,
.modal .equipment-list::-webkit-scrollbar-track,
.modal .horizontal-scroll-container::-webkit-scrollbar-track {
  background: var(--bg-modal);
  border-radius: 3px;
}

.modal .equipment-grid::-webkit-scrollbar-thumb,
.modal .equipment-list::-webkit-scrollbar-thumb,
.modal .horizontal-scroll-container::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
  border: 1px solid var(--bg-modal);
}

.modal .equipment-grid::-webkit-scrollbar-thumb:hover,
.modal .equipment-list::-webkit-scrollbar-thumb:hover,
.modal .horizontal-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--border-primary);
}

/* ==============================
   RESPONSIVE DESIGN
   ============================== */

@media (min-width: 768px) {
  .modal-content {
    border-radius: 15px !important;
    margin: 0 !important;
    /* Override fullscreen margin */
    overflow-y: auto !important;
  }
}

@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: var(--spacing-md);
  }

  .modal-header h2,
  .modal h2 {
    font-size: var(--font-size-xl);
  }

  .checkbox-group {
    flex-direction: column;
  }

  .modal-actions,
  .modal-buttons {
    flex-direction: column;
  }

  .stepper-input-container {
    gap: var(--spacing-lg);
  }
}

/* ==============================
   ANIMATIONS
   ============================== */

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}

/* ==============================
   CONSISTENT CROSS/CLOSE ICON COMPONENT
   ============================== */

/* Base cross icon structure - consistent with burger menu */
.close-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* Cross lines - same style as burger-line but always in cross formation */
.close-line {
  width: 20px;
  height: 2px;
  background-color: var(--burger-color, #EEFDF9);
  position: absolute;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}

/* First line: rotated 45deg */
.close-line:nth-child(1) {
  transform: rotate(45deg);
}

/* Second line: rotated -45deg */
.close-line:nth-child(2) {
  transform: rotate(-45deg);
}

/* Hover effect - subtle translate */
.close-icon:hover {
  transform: translateY(-1px);
}

.close-icon:hover .close-line {
  background-color: var(--burger-color, #EEFDF9);
}

/* Variants for different sizes */
.close-icon.small {
  width: 16px;
  height: 16px;
}

.close-icon.small .close-line {
  width: 16px;
  height: 1.5px;
}

.close-icon.large {
  width: 24px;
  height: 24px;
}

.close-icon.large .close-line {
  width: 24px;
  height: 2.5px;
}

/* Integration with existing modal close buttons */
.modal-close-btn {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 10;
  padding: 0;
}

.modal-close-btn:hover {
  background: var(--bg-button-hover);
  transform: translateY(-1px);
}

/* Integration with delete location buttons */
.btn-delete-location {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: transparent;
  color: var(--text-primary);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 15;
  padding: 0;
}

.btn-delete-location:hover {
  background-color: var(--bg-danger);
  color: white;
  transform: translateY(-1px);
}

/* Color variations for cross lines */
.close-icon.danger .close-line {
  background-color: var(--bg-danger);
}

.close-icon.warning .close-line {
  background-color: var(--bg-warning);
}

.close-icon.success .close-line {
  background-color: var(--bg-success);
}

/* For white backgrounds or special contexts */
.close-icon.dark .close-line {
  background-color: #1a1a1a;
}

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

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

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mb-xl {
  margin-bottom: var(--spacing-xl);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mt-xl {
  margin-top: var(--spacing-xl);
}

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ==============================
   SUBSCRIPTION SYSTEM STYLES
   ============================== */

/* Usage Indicators */
.usage-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.usage-indicator:hover {
  background: var(--bg-hover);
  border-color: var(--border-primary);
}

.usage-indicator.usage-compact {
  padding: var(--spacing-xs);
  font-size: 12px;
  /* Ensure consistent small text size */
}

/* Usage indicator variants */
.usage-indicator.usage-none {
  border-color: var(--success);
  color: var(--success);
}

.usage-indicator.usage-warning {
  border-color: var(--warning);
  color: var(--warning);
}

.usage-indicator.usage-error {
  border-color: var(--error);
  color: var(--error);
}

/* Usage indicator icons */
.usage-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.usage-icon.usage-ok {
  background: var(--success);
}

.usage-icon.usage-warning {
  background: var(--warning);
}

.usage-icon.usage-depleted {
  background: var(--error);
}

/* Usage Modal Styles */
.usage-modal .modal-content {
  max-width: 400px;
}

.usage-details {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.usage-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm);
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
}

.usage-stat.grace-period {
  border: 1px solid var(--warning);
  background: rgba(245, 101, 101, 0.1);
}

.usage-stat-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.usage-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.usage-stat-value.plan-free {
  color: var(--text-secondary);
}

.usage-stat-value.plan-pro {
  color: var(--accent);
}

/* Upgrade prompt */
.upgrade-prompt {
  padding: var(--spacing-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(147, 51, 234, 0.1));
  border: 1px solid var(--accent);
  border-radius: var(--border-radius);
  text-align: center;
}

.upgrade-prompt p {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.btn-upgrade {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  color: white;
  font-weight: 600;
}

.btn-upgrade:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  transform: translateY(-1px);
}

/* Rate Limit Warning Styles */
.rate-limit-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  z-index: 10100;
  /* High z-index to appear on top */
  transform: translateY(-100%);
  transition: transform 0.5s ease-out;
  background: #4d3800;
  /* Dark yellow */
  color: #fde68a;
  border-bottom: 1px solid #a16207;
}

.rate-limit-warning.visible {
  transform: translateY(0);
}

.rate-limit-warning-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fde68a;
  flex-shrink: 0;
}

.rate-limit-warning-text {
  flex: 1;
  font-size: var(--font-size-sm);
  color: #fde68a;
}

/* Subscription Badge */
.subscription-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-badge.plan-free {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subscription-badge.plan-free:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background: rgba(107, 114, 128, 0.3);
}

.subscription-badge.plan-pro {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(147, 51, 234, 0.2));
  color: var(--text-secondary);
  border: 1px solid var(--accent);
}

/* Button with usage indicator */
.btn-with-usage {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-with-usage .usage-indicator {
  margin-left: var(--spacing-sm);
  font-size: 16px;
  /* Consistent with other small text */
  display: inline-flex;
  align-items: center;
}

/* Disable button when usage is depleted */
.btn-usage-depleted {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-secondary) !important;
}

.btn-usage-depleted:hover {
  background: var(--bg-secondary) !important;
  transform: none !important;
}