/* AI-Header: Button component styles with theme support */
/* Date: 2025-07-13 */

/* ===========================================
   BUTTONS - BASE STRUCTURE
   =========================================== */

.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-1px);
}

/* ===========================================
   ICON SURFACE BUTTON (used by Details2 toolbar)
   =========================================== */

.btn-icon-surface {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: none;
    background: var(--surface-header, var(--bs-tertiary-bg));
    color: var(--bs-body-color);
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1;
}

.btn-icon-surface i {
    font-size: 1.2rem;
    line-height: 1;
    vertical-align: middle;
}

.btn-icon-surface:hover { 
    background: color-mix(in srgb, var(--surface-header, var(--bs-tertiary-bg)) 85%, white);
    transform: scale(1.05);
}

@media (max-width: 576px) {
  .btn-icon-surface { width: 40px; height: 40px; }
  .btn-icon-surface i { font-size: 1.1rem; }
}

/* ===========================================
   ACTION TILE BUTTON (used by Details2 action buttons)
   =========================================== */

.btn-action-tile {
    background: var(--surface-action, var(--bs-tertiary-bg));
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    color: var(--action-text-color, var(--bs-body-color));
    padding: 1rem 1.5rem;
    width: 100%;
    display: block;
    text-align: left;
    transition: all 0.2s ease;
}

.btn-action-tile:hover {
    background: var(--surface-action-hover, var(--bs-tertiary-bg));
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.btn-action-tile i { font-size: 1.35rem; width: 26px; text-align: center; margin-right: 1rem; }
.btn-action-tile .btn-primary-text { font-size: 1.1rem; font-weight: 500; display:block; }
.btn-action-tile .btn-secondary-text { font-size: 0.9rem; opacity: 0.8; display:block; margin-top: 0.25rem; }

/* ===========================================
   PRIMARY BUTTONS - LIGHT THEME
   =========================================== */

[data-bs-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #722F37 0%, #5d252b 100%);
    border: 1px solid #722F37;
    box-shadow: 0 2px 4px rgba(114, 47, 55, 0.15);
    color: #ffffff;
}

[data-bs-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, #8B4A52 0%, #722F37 100%);
    border-color: #8B4A52;
    box-shadow: 0 4px 8px rgba(114, 47, 55, 0.25);
    color: #ffffff;
}

/* ===========================================
   PRIMARY BUTTONS - DARK THEME
   =========================================== */

[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #722F37 0%, #5d252b 100%);
    border: 1px solid #722F37;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #8B4A52 0%, #722F37 100%);
    border-color: #8B4A52;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

/* ===========================================
   DANGER BUTTONS - LIGHT THEME
   =========================================== */

[data-bs-theme="light"] .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    border: 1px solid #dc3545;
}

[data-bs-theme="light"] .btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #9e1c26 100%);
    border-color: #c82333;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ===========================================
   DANGER BUTTONS - DARK THEME
   =========================================== */

[data-bs-theme="dark"] .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    border: 1px solid #dc3545;
}

[data-bs-theme="dark"] .btn-danger:hover {
    background: linear-gradient(135deg, #e14856 0%, #c23047 100%);
    border-color: #e14856;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* ===========================================
   THEME TOGGLE BUTTON - LIGHT THEME
   =========================================== */

[data-bs-theme="light"] .theme-toggle-btn {
    background: linear-gradient(135deg, #722F37 0%, #5d252b 100%);
    border: 1px solid #722F37;
    border-radius: 25px;
    padding: 8px 16px;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(114, 47, 55, 0.2);
}

[data-bs-theme="light"] .theme-toggle-btn:hover {
    background: linear-gradient(135deg, #8B4A52 0%, #722F37 100%);
    border-color: #8B4A52;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(114, 47, 55, 0.3);
}

[data-bs-theme="light"] .theme-toggle-btn i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

[data-bs-theme="light"] .theme-toggle-btn:hover i {
    transform: rotate(180deg) scale(1.1);
}

/* ===========================================
   THEME TOGGLE BUTTON - DARK THEME
   =========================================== */

[data-bs-theme="dark"] .theme-toggle-btn {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border: 1px solid #4a5568;
    border-radius: 25px;
    padding: 8px 16px;
    color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    background: linear-gradient(135deg, #5a6578 0%, #3d4758 100%);
    border-color: #ff8a8a;
    color: #ff8a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 138, 138, 0.2);
}

[data-bs-theme="dark"] .theme-toggle-btn i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

[data-bs-theme="dark"] .theme-toggle-btn:hover i {
    transform: rotate(180deg) scale(1.1);
}

/* ===========================================
   BUTTONS - DARK BURGUNDY THEME (UNAUTHENTICATED)
   =========================================== */

/* Submit button for unauthenticated pages */
.submit-btn {
    width: 100%;
    background: #4b5563;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.submit-btn:hover:not(:disabled) { 
    background: #374151; 
}

.submit-btn:active:not(:disabled) { 
    background: #1f2937; 
}

.submit-btn:disabled { 
    background: #4b5563; 
    cursor: not-allowed; 
}

.submit-btn.loading { 
    pointer-events: none; 
}

/* Authentication submit button with dark gray theme */
.auth-submit-btn {
    width: 100%;
    background: #45494C;
    border: none;
    border-radius: 6px;
    padding: 0.875rem 1.5rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.auth-submit-btn:hover:not(:disabled) {
    background: #3a3d40;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(69, 73, 76, 0.3);
}

.auth-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    background: #2f3235;
    box-shadow: 0 2px 6px rgba(69, 73, 76, 0.2);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-submit-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

.auth-submit-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
