/* i3nb Modal System - Header Actions Styles */
/* Standardized styles for modal header buttons/tabs/actions */

/* Container for header actions */
.i3nb-modal-header-actions {
  display: flex;
  gap: 0;
  background: transparent;
  border: none;
  transition: all 0.3s ease;
  flex: 0 0 auto; /* Don't grow or shrink, maintain natural height */
}


/* Position variants for desktop */
@media (min-width: 769px) {
  /* In header - appears inline with title */
  .i3nb-modal-header-actions[data-position="header"] {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 10;
  }
  
  /* Subheader - appears below header */
  .i3nb-modal-header-actions[data-position="subheader"] {
    width: 100%;
    border-bottom: none;
    background: #2d2d2d;
  }
}

/* Base styles for all action buttons */
.i3nb-header-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  font-family: inherit;
  outline: none;
}

.i3nb-header-action:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: -2px;
}

.i3nb-header-action .action-icon {
  font-size: 18px;
  line-height: 1;
}

.i3nb-header-action .action-label {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #666;
}

/* Type: Tabs (e.g., Profile edit mode) */
.i3nb-modal-header-actions.tabs {
  padding: 0;
}

/* Type: Mixed (tabs + actions) */
.i3nb-modal-header-actions.mixed {
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Tabs in header position - blend with gradient like buttons */
.i3nb-modal-header-actions.tabs[data-position="header"] {
  background: transparent;
  gap: 16px;
  height: auto;
  align-items: center;
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action {
  flex: 0 0 auto;
  padding: 8px 6px;
  background: transparent;
  border-radius: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  flex-direction: row;
  gap: 2px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  transition: all 0.2s ease;
  font-size: 13px;
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action::after {
  display: none;
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action .action-icon {
  font-size: 16px;
  margin-bottom: 0;
}

.i3nb-modal-header-actions.tabs[data-position="header"] .i3nb-header-action .action-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: inherit;
}

/* Tabs in subheader position (default styling) */
.i3nb-modal-header-actions.tabs[data-position="subheader"] {
  background: #2d2d2d;
  height: 44px;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  margin: 0;
  border-bottom: none;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action {
  flex: 1;
  border-radius: 0;
  margin: 0;
  padding: 0 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-direction: row;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action:last-child {
  border-right: none;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action.active {
  background: #007bff;
  color: white;
  position: relative;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action.active::after {
  display: none;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action .action-icon {
  font-size: 18px;
}

.i3nb-modal-header-actions.tabs[data-position="subheader"] .i3nb-header-action .action-label {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
}

/* Mixed type in header position */
.i3nb-modal-header-actions.mixed[data-position="header"] {
  background: transparent;
  gap: 0;
  height: auto;
  align-items: center;
}

.i3nb-modal-header-actions.mixed[data-position="header"] .i3nb-header-action {
  flex: 0 0 auto;
  padding: 8px 6px;
  background: transparent;
  border-radius: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  flex-direction: row;
  gap: 2px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  transition: all 0.2s ease;
  font-size: 13px;
}

.i3nb-modal-header-actions.mixed[data-position="header"] .i3nb-header-action:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Tab items in mixed header */
.i3nb-modal-header-actions.mixed .i3nb-header-action[data-item-type="tab"] {
  position: relative;
}

.i3nb-modal-header-actions.mixed .i3nb-header-action[data-item-type="tab"].active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.i3nb-modal-header-actions.mixed .i3nb-header-action[data-item-type="tab"].active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #007bff;
}

/* Separator in mixed header */
.i3nb-modal-header-actions.mixed .i3nb-header-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 8px;
  align-self: center;
}

/* Icons and labels in mixed header */
.i3nb-modal-header-actions.mixed[data-position="header"] .i3nb-header-action .action-icon {
  font-size: 16px;
  margin-bottom: 0;
}

.i3nb-modal-header-actions.mixed[data-position="header"] .i3nb-header-action .action-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: inherit;
}

/* Mixed type in subheader position */
.i3nb-modal-header-actions.mixed[data-position="subheader"] {
  background: #2d2d2d;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: none;
}

.i3nb-modal-header-actions.mixed[data-position="subheader"] .i3nb-header-action {
  padding: 0 16px;
  height: 100%;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-direction: row;
  border-radius: 0;
  margin: 0;
}

.i3nb-modal-header-actions.mixed[data-position="subheader"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.i3nb-modal-header-actions.mixed[data-position="subheader"] .i3nb-header-action[data-item-type="tab"].active {
  background: #007bff;
  color: white;
}

/* Type: Buttons (e.g., Profile view mode) */
.i3nb-modal-header-actions.buttons {
  padding: 0;
  gap: 0;
}

/* Buttons in header position - subtle integrated style */
.i3nb-modal-header-actions.buttons[data-position="header"] {
  gap: 12px;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action {
  flex: 0 0 auto;
  padding: 8px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border-right: none;
  border-radius: 0;
  flex-direction: row;
  gap: 2px;
  height: auto;
  align-items: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action:last-child {
  border-right: none;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action::after {
  display: none;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action .action-icon {
  font-size: 14px;
  margin-bottom: 0;
}

.i3nb-modal-header-actions.buttons[data-position="header"] .i3nb-header-action .action-label {
  font-size: 12px;
  font-weight: 500;
  color: inherit;
}


/* Buttons in subheader position (default styling) */
.i3nb-modal-header-actions.buttons[data-position="subheader"] {
  background: #2d2d2d;
  height: 44px;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  margin: 0;
  border-bottom: none;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action {
  flex: 1;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action:last-child {
  border-right: none;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action::after {
  display: none;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action .action-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.i3nb-modal-header-actions.buttons[data-position="subheader"] .i3nb-header-action .action-label {
  font-size: 11px;
  font-weight: 500;
  color: inherit;
}

/* Type: Actions (e.g., Photo editor save/cancel) */
.i3nb-modal-header-actions.actions {
  padding: 12px 20px;
  gap: 12px;
  justify-content: flex-end;
}

/* Actions in header position - use same dark styling as buttons */
.i3nb-modal-header-actions.actions[data-position="header"] {
  padding: 0;
  gap: 0;
  justify-content: center;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.i3nb-modal-header-actions.actions[data-position="header"] .i3nb-header-action {
  flex: 0 0 auto;
  padding: 8px 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 0;
  flex-direction: row;
  gap: 2px;
  height: auto;
  align-items: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.i3nb-modal-header-actions.actions[data-position="header"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: transparent;
}

.i3nb-modal-header-actions.actions[data-position="header"] .i3nb-header-action::after {
  display: none;
}

.i3nb-modal-header-actions.actions[data-position="header"] .i3nb-header-action .action-icon {
  font-size: 14px;
  margin-bottom: 0;
}

.i3nb-modal-header-actions.actions[data-position="header"] .i3nb-header-action .action-label {
  font-size: 12px;
  font-weight: 500;
  color: inherit;
}

/* Actions in subheader position - use dark styling */
.i3nb-modal-header-actions.actions[data-position="subheader"] {
  background: #2d2d2d;
  height: 44px;
  display: flex;
  align-items: stretch;
  width: 100%;
  padding: 0;
  margin: 0;
  border-bottom: none;
}

.i3nb-modal-header-actions.actions[data-position="subheader"] .i3nb-header-action {
  flex: 1;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.i3nb-modal-header-actions.actions[data-position="subheader"] .i3nb-header-action:last-child {
  border-right: none;
}

.i3nb-modal-header-actions.actions[data-position="subheader"] .i3nb-header-action:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.i3nb-modal-header-actions.actions[data-position="subheader"] .i3nb-header-action .action-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.i3nb-modal-header-actions.actions[data-position="subheader"] .i3nb-header-action .action-label {
  font-size: 11px;
  font-weight: 500;
  color: inherit;
}

/* Default actions (not in header/subheader) - keep original light styling */
.i3nb-modal-header-actions.actions:not([data-position="header"]):not([data-position="subheader"]) .i3nb-header-action {
  flex: 0 0 auto;
  padding: 8px 20px;
  border-radius: 6px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  flex-direction: row;
  gap: 8px;
}

.i3nb-modal-header-actions.actions:not([data-position="header"]):not([data-position="subheader"]) .i3nb-header-action:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.i3nb-modal-header-actions.actions .i3nb-header-action.primary {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.i3nb-modal-header-actions.actions .i3nb-header-action.primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.i3nb-modal-header-actions.actions .i3nb-header-action.primary .action-label {
  color: white;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Reset desktop positioning for all header actions on mobile */
  .i3nb-modal-header-actions {
    position: relative;
    transform: none;
    left: auto;
    top: auto;
    width: 100%;
    margin: 0;
  }
  
  /* Ensure dark background for tabs in subheader on mobile */
  .i3nb-modal-header-actions.tabs[data-position="subheader"] {
    background: #2d2d2d;
  }
  
  /* Ensure dark background for buttons in subheader on mobile */
  .i3nb-modal-header-actions.buttons[data-position="subheader"] {
    background: #2d2d2d;
  }
  
  
  
  /* Below header position (default for mobile) */
  .i3nb-modal-header-actions[data-mobile-position="below-header"] {
    border-bottom: none;
    z-index: 10;
  }
  
  /* Top pane position (for converted left pane) */
  .i3nb-modal-header-actions[data-mobile-position="top-pane"] {
    /* Will be handled by modal system's mobile conversion */
    width: 100%;
    height: auto;
    min-height: 60px;
  }
  
  /* Adjust button sizes for mobile */
  .i3nb-header-action {
    padding: 12px 8px;
  }
  
  
  /* Mobile actions in a row */
  .i3nb-modal-header-actions.actions {
    padding: 0;
    border-bottom: 1px solid #dee2e6;
  }
  
  .i3nb-modal-header-actions.actions .i3nb-header-action {
    flex: 1;
    border-radius: 0;
    border: none;
    border-right: 1px solid #dee2e6;
    padding: 12px;
    background: #f8f9fa;
  }
  
  .i3nb-modal-header-actions.actions .i3nb-header-action:last-child {
    border-right: none;
  }
  
  .i3nb-modal-header-actions.actions .i3nb-header-action.primary {
    background: #007bff;
  }
  
  /* Action buttons stack on very small screens */
  @media (max-width: 480px) {
    .i3nb-modal-header-actions.actions {
      flex-direction: row; /* Keep in row even on small screens */
    }
    
    .i3nb-modal-header-actions.actions .i3nb-header-action {
      flex: 1;
      justify-content: center;
      padding: 10px 4px;
    }
    
    .i3nb-modal-header-actions.actions .i3nb-header-action .action-label {
      font-size: 10px;
    }
  }
}

/* Animation for tab switching */
@keyframes tabContentFadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

[data-tab-content] {
  display: none;
}

[data-tab-content].active {
  display: block;
  animation: tabContentFadeIn 0.3s ease;
}

/* Disabled state */
.i3nb-header-action:disabled,
.i3nb-header-action.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading state */
.i3nb-header-action.loading .action-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}