/* ==================== FLOWCAPTAIN BUTTON SYSTEM ==================== */
/* Professional, consistent button system for the entire application */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  vertical-align: middle;
  min-height: 40px;
  box-sizing: border-box;
}

.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* Button Sizes */
.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  min-height: 24px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
  min-height: 32px;
}

.btn-md {
  padding: 10px 16px;
  font-size: 0.875rem;
  min-height: 40px;
}

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

.btn-xl {
  padding: 16px 24px;
  font-size: 1.125rem;
  min-height: 56px;
}

/* Button Variants */
.btn-primary {
  background: var(--primary, #294A42);
  color: white;
  box-shadow: 0 2px 4px rgba(41, 74, 66, 0.2);
}

.btn-primary .icon {
  filter: invert(1) brightness(1); /* Make icons white in primary buttons */
}

.btn-primary:hover {
  background: var(--primary-dark, #1e3530);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(41, 74, 66, 0.3);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--primary, #294A42);
  color: var(--primary, #294A42);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(41, 74, 66, 0.1);
  border-color: var(--primary, #294A42);
  color: var(--primary, #294A42);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(41, 74, 66, 0.15);
}

.btn-secondary:active {
  background: var(--primary, #294A42);
  color: white;
  transform: translateY(0);
}

.btn-success {
  background: var(--success, #28a745);
  color: white;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn-success .icon {
  filter: invert(1) brightness(1); /* Make icons white in success buttons */
}

.btn-success:hover {
  background: var(--success-dark, #218838);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-danger {
  background: var(--danger, #dc3545);
  color: white;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-danger .icon {
  filter: invert(1) brightness(1); /* Make icons white in danger buttons */
}

.btn-danger:hover {
  background: var(--danger-dark, #c82333);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-warning {
  background: var(--warning, #ffc107);
  color: var(--text, #333);
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-warning:hover {
  background: var(--warning-dark, #e0a800);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-info {
  background: var(--info, #17a2b8);
  color: white;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.btn-info .icon {
  filter: invert(1) brightness(1); /* Make icons white in info buttons */
}

.btn-info:hover {
  background: var(--info-dark, #138496);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

/* Outline Variants */
.btn-outline-primary {
  background: transparent;
  color: var(--primary, #294A42);
  border: 2px solid var(--primary, #294A42);
}

.btn-outline-primary:hover {
  background: var(--primary, #294A42);
  color: white;
  transform: translateY(-1px);
}

.btn-outline-secondary {
  background: transparent;
  color: var(--secondary, #6c757d);
  border: 2px solid var(--secondary, #6c757d);
}

.btn-outline-secondary:hover {
  background: var(--secondary, #6c757d);
  color: white;
  transform: translateY(-1px);
}

/* Ghost Variants */
.btn-ghost {
  background: transparent;
  color: var(--text, #333);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
}

.btn-ghost-primary {
  background: transparent;
  color: var(--primary, #294A42);
  border: none;
}

.btn-ghost-primary:hover {
  background: rgba(41, 74, 66, 0.1);
}

/* Special Button Styles */
.btn-gradient {
  background: linear-gradient(135deg, var(--primary, #294A42) 0%, var(--primary-light, #3a6b5e) 100%);
  color: white;
  border: none;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, var(--primary-dark, #1e3530) 0%, var(--primary, #294A42) 100%);
  transform: translateY(-1px);
}

/* Action Button Styles (for profile actions) */
.btn-action {
  /* Width controlled by parent container (cards.css) */
  justify-content: center;
  text-align: center;
  padding: 12px 16px;
  font-weight: 500;
  background: white;
  color: var(--text, #333);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 48px; /* Fixed height for all action buttons */
  max-height: 48px; /* Prevent height variations */
}

.btn-action:hover {
  background: var(--bg-light, #f8f9fa);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-action.btn-primary {
  background: var(--primary, #294A42);
  color: white;
  border-color: var(--primary, #294A42);
}

.btn-action.btn-danger {
  background: var(--danger, #dc3545);
  color: white;
  border-color: var(--danger, #dc3545);
}

/* Navigation Button Styles */
.btn-nav {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-nav-primary {
  background: var(--accent, #FFDC63);
  color: var(--text-dark, #1d1d1f);
  border: none;
}

.btn-nav-primary:hover {
  background: var(--accent-dark, #f4d03f);
  transform: translateY(-1px);
}

.btn-nav-secondary {
  background: transparent;
  color: var(--text-light, rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-nav-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Hero Button Styles */
.btn-hero {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  min-width: 120px;
  transition: all 0.2s ease;
}

.btn-hero-start {
  background: var(--success, #28a745);
  color: white;
  border: none;
}

.btn-hero-start:hover {
  background: var(--success-dark, #218838);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

.btn-hero-stop {
  background: var(--danger, #dc3545);
  color: white;
  border: none;
}

.btn-hero-stop:hover {
  background: var(--danger-dark, #c82333);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

/* Header Button Styles */
.btn-header {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  background: var(--accent, #FFDC63);
  color: var(--text-dark, #1d1d1f);
  border: none;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: var(--accent-dark, #f4d03f);
  transform: translateY(-1px);
}

.btn-header-secondary {
  background: transparent;
  color: var(--text-light, rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-header-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Modal Button Styles */
.btn-modal {
  min-width: 100px;
  padding: 10px 20px;
}

/* Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: btn-spinner 0.8s linear infinite;
}

@keyframes btn-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Button Groups */
.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group .btn {
  border-radius: 0;
  border-right-width: 0;
}

.btn-group .btn:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-right-width: 1px;
}

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

/* Button Grid for Profile Actions */
.btn-grid {
  display: grid;
  gap: 12px;
}

.btn-grid-1 { grid-template-columns: 1fr; }
.btn-grid-2 { grid-template-columns: 1fr 1fr; }
.btn-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Responsive Button Behavior */
@media (max-width: 768px) {
  .btn {
    padding: 12px 16px;
    min-height: 44px; /* Better mobile touch targets */
  }
  
  .btn-nav {
    padding: 10px 14px;
    font-size: 0.8125rem;
  }
  
  .btn-header {
    padding: 8px 12px;
    font-size: 0.8125rem;
  }
  
  /* Mobile: always single column for action buttons */
  .btn-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 14px 16px;
    min-height: 48px;
    font-size: 0.9375rem;
  }
  
  .btn-sm {
    padding: 10px 12px;
    min-height: 40px;
  }
}

/* Large Time Tracking Icons (no buttons) */
.icon-time-tracking {
  width: 100px !important;
  height: 100px !important;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Success (green) and danger (red) icon colors */
.icon-success {
  filter: invert(64%) sepia(98%) saturate(459%) hue-rotate(81deg) brightness(94%) contrast(95%); /* Green */
}

.icon-danger {
  filter: invert(35%) sepia(95%) saturate(7500%) hue-rotate(350deg) brightness(105%) contrast(95%); /* Red */
}

/* Hover effects for clickable icons */
.icon-time-tracking:hover {
  transform: translateY(-2px) scale(1.1);
  filter: brightness(1.2);
}

.icon-time-tracking:active {
  transform: translateY(0) scale(0.95);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .btn-action {
    background: var(--card-bg, #2d3748);
    color: var(--text-light, #e2e8f0);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .btn-ghost {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #e2e8f0);
  }
  
  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
  }
}