/* ============================================================================
   HRM UI COMPONENTS - Additional Interactive Elements
   Toast Notifications, Modals, Loading States, and More
   ============================================================================ */

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

#hrm-toast-container {
    position: fixed;
    top: 32px;
    right: 20px;
    z-index: var(--hrm-z-tooltip, 10000);
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.hrm-toast {
    background: var(--hrm-bg-card, #FFFFFF);
    border-radius: var(--hrm-radius-lg, 12px);
    box-shadow: var(--hrm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
}

.hrm-toast-success {
    border-left-color: var(--hrm-success, #10B981);
}

.hrm-toast-error,
.hrm-toast-danger {
    border-left-color: var(--hrm-danger, #EF4444);
}

.hrm-toast-warning {
    border-left-color: var(--hrm-warning, #F59E0B);
}

.hrm-toast-info {
    border-left-color: var(--hrm-info, #3B82F6);
}

.hrm-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.hrm-toast-icon {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.hrm-toast-success .hrm-toast-icon {
    color: var(--hrm-success, #10B981);
}

.hrm-toast-error .hrm-toast-icon,
.hrm-toast-danger .hrm-toast-icon {
    color: var(--hrm-danger, #EF4444);
}

.hrm-toast-warning .hrm-toast-icon {
    color: var(--hrm-warning, #F59E0B);
}

.hrm-toast-info .hrm-toast-icon {
    color: var(--hrm-info, #3B82F6);
}

.hrm-toast-message {
    font-size: var(--hrm-text-sm, 14px);
    font-weight: var(--hrm-font-medium, 500);
    color: var(--hrm-text-primary, #111827);
    line-height: 1.5;
}

.hrm-toast-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--hrm-text-tertiary, #9CA3AF);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hrm-radius-sm, 6px);
    transition: var(--hrm-transition-fast, 150ms ease);
}

.hrm-toast-close:hover {
    background: var(--hrm-gray-100, #F3F4F6);
    color: var(--hrm-text-primary, #111827);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================================================
   LOADING OVERLAY
   ============================================================================ */

.hrm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: var(--hrm-z-modal, 1050);
    border-radius: inherit;
}

.hrm-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--hrm-gray-200, #E5E7EB);
    border-top-color: var(--hrm-primary, #0C8776);
    border-radius: 50%;
    animation: hrm-spin 0.8s linear infinite;
}

.hrm-loading-message {
    font-size: var(--hrm-text-sm, 14px);
    font-weight: var(--hrm-font-medium, 500);
    color: var(--hrm-text-secondary, #6B7280);
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.hrm-empty-state {
    text-align: center;
    padding: var(--hrm-space-12, 3rem) var(--hrm-space-6, 1.5rem);
    background: var(--hrm-bg-card, #FFFFFF);
    border-radius: var(--hrm-radius-xl, 16px);
    border: 2px dashed var(--hrm-border-default, #E5E7EB);
}

.hrm-empty-state-icon {
    font-size: 64px;
    color: var(--hrm-gray-300, #D1D5DB);
    margin-bottom: var(--hrm-space-4, 1rem);
}

.hrm-empty-state-title {
    font-size: var(--hrm-text-xl, 1.25rem);
    font-weight: var(--hrm-font-bold, 700);
    color: var(--hrm-text-primary, #111827);
    margin: 0 0 var(--hrm-space-2, 0.5rem);
}

.hrm-empty-state-description {
    font-size: var(--hrm-text-sm, 14px);
    color: var(--hrm-text-secondary, #6B7280);
    margin: 0 0 var(--hrm-space-6, 1.5rem);
    line-height: 1.6;
}

.hrm-empty-state-action {
    margin-top: var(--hrm-space-6, 1.5rem);
}

/* ============================================================================
   PROGRESS BARS
   ============================================================================ */

.hrm-progress {
    width: 100%;
    height: 8px;
    background: var(--hrm-gray-200, #E5E7EB);
    border-radius: var(--hrm-radius-full, 9999px);
    overflow: hidden;
    position: relative;
}

.hrm-progress-bar {
    height: 100%;
    background: var(--hrm-gradient-primary, linear-gradient(135deg, #064E4C 0%, #0C8776 100%));
    border-radius: var(--hrm-radius-full, 9999px);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hrm-progress-bar.success {
    background: var(--hrm-gradient-success, linear-gradient(135deg, #10B981 0%, #059669 100%));
}

.hrm-progress-bar.warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.hrm-progress-bar.danger {
    background: var(--hrm-gradient-danger, linear-gradient(135deg, #EF4444 0%, #DC2626 100%));
}

.hrm-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--hrm-space-2, 0.5rem);
    font-size: var(--hrm-text-xs, 12px);
    font-weight: var(--hrm-font-medium, 500);
    color: var(--hrm-text-secondary, #6B7280);
}

/* Animated progress bar */
.hrm-progress-bar.animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================================================
   TABS
   ============================================================================ */

.hrm-tabs {
    display: flex;
    flex-direction: column;
    gap: var(--hrm-space-6, 1.5rem);
}

.hrm-tabs-nav {
    display: flex;
    gap: var(--hrm-space-2, 0.5rem);
    border-bottom: 2px solid var(--hrm-border-light, #F3F4F6);
    padding: 0 var(--hrm-space-2, 0.5rem);
    overflow-x: auto;
}

.hrm-tab-btn-nav {
    padding: var(--hrm-space-3, 0.75rem) var(--hrm-space-4, 1rem);
    font-size: var(--hrm-text-sm, 14px);
    font-weight: var(--hrm-font-medium, 500);
    color: var(--hrm-text-secondary, #6B7280);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--hrm-transition-fast, 150ms ease);
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
}

.hrm-tab-btn-nav:hover {
    color: var(--hrm-text-primary, #111827);
    background: var(--hrm-gray-50, #F9FAFB);
    border-radius: var(--hrm-radius-md, 8px) var(--hrm-radius-md, 8px) 0 0;
}

.hrm-tab-btn-nav.active {
    color: var(--hrm-primary, #0C8776);
    border-bottom-color: var(--hrm-primary, #0C8776);
    font-weight: var(--hrm-font-semibold, 600);
}

.hrm-tab-content {
    display: none;
    animation: hrm-fadeIn 0.3s ease;
}

.hrm-tab-content.active {
    display: block;
}

/* ============================================================================
   ALERTS / BANNERS
   ============================================================================ */

.hrm-alert {
    padding: var(--hrm-space-4, 1rem) var(--hrm-space-5, 1.25rem);
    border-radius: var(--hrm-radius-lg, 12px);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--hrm-space-3, 0.75rem);
    margin-bottom: var(--hrm-space-4, 1rem);
}

.hrm-alert-success {
    background: var(--hrm-success-light, #D1FAE5);
    border-left-color: var(--hrm-success, #10B981);
    color: var(--hrm-success-dark, #065F46);
}

.hrm-alert-warning {
    background: var(--hrm-warning-light, #FEF3C7);
    border-left-color: var(--hrm-warning, #F59E0B);
    color: var(--hrm-warning-dark, #D97706);
}

.hrm-alert-danger,
.hrm-alert-error {
    background: var(--hrm-danger-light, #FEE2E2);
    border-left-color: var(--hrm-danger, #EF4444);
    color: var(--hrm-danger-dark, #B91C1C);
}

.hrm-alert-info {
    background: var(--hrm-info-light, #DBEAFE);
    border-left-color: var(--hrm-info, #3B82F6);
    color: var(--hrm-info-dark, #1E40AF);
}

.hrm-alert-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.hrm-alert-content {
    flex: 1;
}

.hrm-alert-title {
    font-size: var(--hrm-text-sm, 14px);
    font-weight: var(--hrm-font-semibold, 600);
    margin: 0 0 var(--hrm-space-1, 0.25rem);
}

.hrm-alert-message {
    font-size: var(--hrm-text-sm, 14px);
    line-height: 1.5;
    margin: 0;
}

.hrm-alert-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: currentColor;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.hrm-alert-close:hover {
    opacity: 1;
}

/* ============================================================================
   TOOLTIPS
   ============================================================================ */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--hrm-transition-fast, 150ms ease);
    z-index: var(--hrm-z-tooltip, 1070);
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    background: var(--hrm-gray-900, #111827);
    color: white;
    padding: var(--hrm-space-2, 0.5rem) var(--hrm-space-3, 0.75rem);
    border-radius: var(--hrm-radius-md, 8px);
    font-size: var(--hrm-text-xs, 12px);
    white-space: nowrap;
    max-width: 200px;
    text-align: center;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    margin-bottom: 8px;
}

[data-tooltip]::after {
    content: '';
    border: 6px solid transparent;
    border-top-color: var(--hrm-gray-900, #111827);
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   DIVIDER
   ============================================================================ */

.hrm-divider {
    height: 1px;
    background: var(--hrm-border-light, #F3F4F6);
    margin: var(--hrm-space-6, 1.5rem) 0;
}

.hrm-divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--hrm-space-6, 1.5rem) 0;
    font-size: var(--hrm-text-xs, 12px);
    color: var(--hrm-text-tertiary, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--hrm-font-semibold, 600);
}

.hrm-divider-text::before,
.hrm-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--hrm-border-light, #F3F4F6);
}

.hrm-divider-text::before {
    margin-right: var(--hrm-space-4, 1rem);
}

.hrm-divider-text::after {
    margin-left: var(--hrm-space-4, 1rem);
}

/* ============================================================================
   AVATAR GROUP
   ============================================================================ */

.hrm-avatar-group {
    display: flex;
    align-items: center;
    padding-left: var(--hrm-space-2, 0.5rem);
}

.hrm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hrm-gray-300, #D1D5DB);
    color: var(--hrm-text-primary, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--hrm-text-xs, 12px);
    font-weight: var(--hrm-font-semibold, 600);
    border: 2px solid white;
    margin-left: calc(var(--hrm-space-2, 0.5rem) * -1);
    position: relative;
    transition: var(--hrm-transition-fast, 150ms ease);
}

.hrm-avatar:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.hrm-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.hrm-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: var(--hrm-text-sm, 14px);
}

.hrm-avatar-sm {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

/* ============================================================================
   STAT CARD VARIANTS
   ============================================================================ */

.hrm-stat-card-mini {
    background: var(--hrm-bg-card, #FFFFFF);
    border-radius: var(--hrm-radius-lg, 12px);
    padding: var(--hrm-space-5, 1.25rem);
    border: 1px solid var(--hrm-border-default, #E5E7EB);
    transition: var(--hrm-transition-base, 200ms ease);
}

.hrm-stat-card-mini:hover {
    box-shadow: var(--hrm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    transform: translateY(-2px);
}

.hrm-stat-card-mini-label {
    font-size: var(--hrm-text-xs, 12px);
    font-weight: var(--hrm-font-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hrm-text-tertiary, #9CA3AF);
    margin-bottom: var(--hrm-space-2, 0.5rem);
}

.hrm-stat-card-mini-value {
    font-size: var(--hrm-text-3xl, 1.875rem);
    font-weight: var(--hrm-font-bold, 700);
    line-height: 1;
    color: var(--hrm-text-primary, #111827);
}

.hrm-stat-card-mini-change {
    display: inline-flex;
    align-items: center;
    gap: var(--hrm-space-1, 0.25rem);
    margin-top: var(--hrm-space-2, 0.5rem);
    font-size: var(--hrm-text-xs, 12px);
    font-weight: var(--hrm-font-medium, 500);
}

.hrm-stat-card-mini-change.positive {
    color: var(--hrm-success, #10B981);
}

.hrm-stat-card-mini-change.negative {
    color: var(--hrm-danger, #EF4444);
}

/* ============================================================================
   MOBILE RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 768px) {
    #hrm-toast-container {
        right: 10px;
        left: 10px;
        top: 20px;
    }

    .hrm-toast {
        min-width: auto;
        max-width: none;
    }

    .hrm-tabs-nav {
        gap: var(--hrm-space-1, 0.25rem);
    }

    [data-tooltip]::before {
        max-width: 150px;
        white-space: normal;
    }
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Focus visible for keyboard navigation */
.hrm-btn-primary:focus-visible,
.hrm-btn-outline:focus-visible,
.hrm-input:focus-visible,
.hrm-select:focus-visible,
.hrm-tab-btn-nav:focus-visible {
    outline: 2px solid var(--hrm-primary, #0C8776);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}