/* Main CSS - Design System and Base Styles */

/* Import Form Validation Styles */
@import url('form-validation.css');

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Management */
.keyboard-navigation *:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--focus-ring-offset), 0 0 0 4px var(--focus-ring);
}

.mouse-navigation *:focus {
    outline: none;
}

/* High Contrast Mode Support */
.high-contrast {
    --primary-color: #0000ff;
    --danger-color: #ff0000;
    --success-color: #008000;
    --warning-color: #ffff00;
    --gray-100: #ffffff;
    --gray-900: #000000;
}

.high-contrast .nav-link:focus {
    border: 2px solid currentColor;
}

/* Reduced Motion Support */
.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Keyboard Shortcuts Help Modal */
.keyboard-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--animation-duration-normal) var(--animation-easing);
}

.keyboard-help-modal .modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-overlay);
    backdrop-filter: blur(4px);
}

.keyboard-help-modal .modal-content {
    position: relative;
    background: var(--surface-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    max-height: 80vh;
    width: 90vw;
    overflow: hidden;
    animation: slideInUp var(--animation-duration-normal) var(--animation-easing);
}

.keyboard-help-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.keyboard-help-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.keyboard-help-modal .modal-close {
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.keyboard-help-modal .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.keyboard-help-modal .modal-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

.keyboard-help-modal .modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.keyboard-help-modal .shortcuts-grid {
    display: grid;
    gap: 1rem;
}

.keyboard-help-modal .shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.keyboard-help-modal .shortcut-keys {
    font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    box-shadow: inset 0 1px 0 var(--gray-200), 0 1px 0 var(--gray-100);
}

.keyboard-help-modal .shortcut-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-left: 1rem;
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Progressive Loading & Skeleton Screens */
.loading-skeleton {
    overflow: hidden;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.animate-pulse {
    animation: skeleton-loading 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, 
        var(--gray-100) 25%, 
        var(--gray-200) 50%, 
        var(--gray-100) 75%
    );
    background-size: 200px 100%;
}

/* Skeleton Components */
.skeleton-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface-primary);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-200);
    margin-right: 1rem;
    flex-shrink: 0;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    margin-bottom: 8px;
}

.skeleton-line-title {
    width: 60%;
    height: 16px;
    margin-bottom: 12px;
}

.skeleton-line-subtitle {
    width: 40%;
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-line-text {
    width: 80%;
}

.skeleton-line-primary {
    width: 70%;
    height: 14px;
}

.skeleton-line-secondary {
    width: 50%;
    height: 12px;
}

.skeleton-line-full {
    width: 100%;
}

.skeleton-line-large {
    width: 85%;
}

.skeleton-line-medium {
    width: 65%;
}

.skeleton-line-name {
    width: 60%;
    height: 18px;
    margin-bottom: 8px;
}

.skeleton-line-location {
    width: 40%;
    height: 12px;
}

/* Skeleton List */
.skeleton-list {
    space-y: 1rem;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--surface-primary);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.skeleton-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-200);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.skeleton-text-container {
    flex: 1;
}

/* Skeleton Table */
.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table-header {
    display: flex;
    padding: 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.skeleton-table-header-cell {
    flex: 1;
    height: 16px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-right: 1rem;
}

.skeleton-table-header-cell:last-child {
    margin-right: 0;
}

.skeleton-table-body {
    display: flex;
    flex-direction: column;
}

.skeleton-table-row {
    display: flex;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.skeleton-table-cell {
    flex: 1;
    height: 14px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-right: 1rem;
}

.skeleton-table-cell:last-child {
    margin-right: 0;
}

/* Skeleton Profile */
.skeleton-profile {
    background: var(--surface-primary);
    border-radius: 8px;
    padding: 1.5rem;
}

.skeleton-profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.skeleton-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-200);
    margin-right: 1rem;
    flex-shrink: 0;
}

.skeleton-profile-info {
    flex: 1;
}

.skeleton-profile-body {
    space-y: 0.75rem;
}

/* Skeleton Chart */
.skeleton-chart {
    background: var(--surface-primary);
    border-radius: 8px;
    padding: 1.5rem;
}

.skeleton-chart-header {
    margin-bottom: 2rem;
}

.skeleton-chart-body {
    height: 200px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding: 1rem 0;
}

.skeleton-chart-bars {
    display: flex;
    align-items: end;
    width: 100%;
    height: 100%;
    gap: 0.5rem;
}

.skeleton-chart-bar {
    flex: 1;
    background: var(--gray-200);
    border-radius: 4px 4px 0 0;
    min-height: 20px;
}

/* Skeleton Form */
.skeleton-form {
    background: var(--surface-primary);
    border-radius: 8px;
    padding: 1.5rem;
    space-y: 1rem;
}

.skeleton-field {
    margin-bottom: 1rem;
}

.skeleton-label {
    width: 30%;
    height: 14px;
    background: var(--gray-200);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-input {
    width: 100%;
    height: 40px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

.skeleton-button {
    width: 120px;
    height: 40px;
    background: var(--gray-200);
    border-radius: 6px;
    margin-top: 1rem;
}

/* Loading States */
.is-loading {
    position: relative;
    pointer-events: none;
}

.is-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Image Loading States */
img[data-src] {
    background: var(--gray-100);
    min-height: 100px;
}

img.loading {
    opacity: 0.7;
    animation: pulse 1.5s ease-in-out infinite;
}

img.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img.error {
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

/* Error States */
.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--surface-primary);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.error-state .error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

/* Progressive Enhancement */
@supports (backdrop-filter: blur(8px)) {
    .loading-overlay {
        backdrop-filter: blur(4px);
    }
}

/* High contrast mode adjustments */
.high-contrast .skeleton-line,
.high-contrast .skeleton-avatar,
.high-contrast .skeleton-circle {
    background: var(--gray-600);
}

/* Reduced motion adjustments */
.reduced-motion .animate-pulse {
    animation: none;
    background: var(--gray-200);
}

.reduced-motion .is-loading::after {
    animation: none;
}

/* Form Validation Styles */
.field-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.field-container input,
.field-container textarea,
.field-container select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color var(--animation-duration-fast) var(--animation-easing),
                box-shadow var(--animation-duration-fast) var(--animation-easing);
}

.field-container input:focus,
.field-container textarea:focus,
.field-container select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Field States */
.field-valid {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 1px var(--success-color) !important;
}

.field-invalid {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 1px var(--danger-color) !important;
}

.has-error input,
.has-error textarea,
.has-error select {
    border-color: var(--danger-color);
}

.has-success input,
.has-success textarea,
.has-success select {
    border-color: var(--success-color);
}

/* Validation Messages */
.validation-message {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--danger-light);
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    color: var(--danger-dark);
    font-size: 0.875rem;
    animation: slideInDown var(--animation-duration-normal) var(--animation-easing);
}

.validation-message.visible {
    display: block;
}

.validation-message::before {
    content: '⚠️';
    margin-right: 0.5rem;
}

/* Validation Summary */
.validation-summary {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--danger-light);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    animation: slideInDown var(--animation-duration-normal) var(--animation-easing);
}

.validation-summary h3 {
    margin: 0 0 0.75rem 0;
    color: var(--danger-dark);
    font-size: 1rem;
    font-weight: 600;
}

.validation-summary .error-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-summary .error-list li {
    margin-bottom: 0.5rem;
}

.validation-summary .error-link {
    color: var(--danger-dark);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.validation-summary .error-link:hover {
    background: rgba(239, 68, 68, 0.1);
    text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength-container {
    margin-top: 0.5rem;
}

.password-strength {
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.875rem;
}

.strength-meter {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: width var(--animation-duration-normal) var(--animation-easing),
                background-color var(--animation-duration-normal) var(--animation-easing);
    border-radius: 3px;
}

.strength-fill.weak {
    background: var(--danger-color);
}

.strength-fill.medium {
    background: var(--warning-color);
}

.strength-fill.strong {
    background: var(--success-color);
}

.strength-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.strength-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.requirement {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-600);
}

.requirement.valid {
    color: var(--success-dark);
}

.requirement.invalid {
    color: var(--danger-dark);
}

.requirement .check-icon {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
    border-radius: 50%;
    background: var(--gray-300);
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.requirement.valid .check-icon {
    background: var(--success-color);
}

.requirement.invalid .check-icon {
    background: var(--danger-color);
}

/* Password Toggle */
.password-toggle-container {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.password-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: color var(--animation-duration-fast) var(--animation-easing);
}

.password-toggle:hover {
    color: var(--gray-700);
}

.password-toggle .toggle-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Character Counter */
.character-counter {
    margin-top: 0.25rem;
    text-align: right;
    font-size: 0.75rem;
    color: var(--gray-500);
    transition: color var(--animation-duration-fast) var(--animation-easing);
}

.character-counter.warning {
    color: var(--warning-color);
}

.character-counter.error {
    color: var(--danger-color);
}

/* Field Help */
.field-help-btn {
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    background: var(--surface-primary);
    color: var(--gray-500);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--animation-duration-fast) var(--animation-easing);
}

.field-help-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.field-help {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--surface-primary);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--animation-duration-normal) var(--animation-easing);
}

.field-help.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.field-help .help-content {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.field-help .help-content p {
    margin: 0;
}

/* File Upload Enhancement */
.file-upload-enhanced {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background: var(--gray-50);
    transition: all var(--animation-duration-normal) var(--animation-easing);
    cursor: pointer;
}

.file-upload-enhanced:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-enhanced.dragover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.02);
}

.file-upload-enhanced input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-icon {
    width: 2rem;
    height: 2rem;
    margin: 0 auto 1rem;
    color: var(--gray-400);
}

.file-upload-text {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.file-upload-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Progressive Disclosure */
.progressive-trigger {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    transition: color var(--animation-duration-fast) var(--animation-easing);
}

.progressive-trigger:hover {
    color: var(--primary-hover);
}

.progressive-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all var(--animation-duration-normal) var(--animation-easing);
}

.progressive-content.visible {
    opacity: 1;
    max-height: 500px;
}

/* Form Steps */
.form-steps {
    display: flex;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}

.form-step {
    flex: 1;
    position: relative;
    text-align: center;
}

.form-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: -50%;
    width: 100%;
    height: 2px;
    background: var(--gray-200);
    z-index: 1;
}

.form-step.completed::after {
    background: var(--success-color);
}

.step-indicator {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    z-index: 2;
    transition: all var(--animation-duration-normal) var(--animation-easing);
}

.form-step.active .step-indicator {
    background: var(--primary-color);
    color: white;
}

.form-step.completed .step-indicator {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.form-step.active .step-label {
    color: var(--primary-color);
}

.form-step.completed .step-label {
    color: var(--success-color);
}

/* High contrast mode adjustments */
.high-contrast .field-valid {
    border-color: #008000 !important;
    box-shadow: 0 0 0 2px #008000 !important;
}

.high-contrast .field-invalid {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 2px #ff0000 !important;
}

.high-contrast .validation-message {
    background: #ffffff;
    border: 2px solid #ff0000;
    color: #000000;
}

/* Reduced motion adjustments */
.reduced-motion .validation-message,
.reduced-motion .validation-summary,
.reduced-motion .field-help {
    animation: none;
    transition: none;
}

.reduced-motion .strength-fill {
    transition: none;
}

/* Enhanced Table Styles */
.enhanced-table-container {
    background: var(--surface-primary);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.selected-count {
    color: var(--primary-color);
    font-weight: 500;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

.enhanced-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.enhanced-table th {
    position: sticky;
    top: 0;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: 0;
    font-weight: 600;
    color: var(--gray-700);
    text-align: left;
    user-select: none;
    z-index: 10;
}

.enhanced-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.enhanced-table tbody tr:hover {
    background: var(--gray-50);
}

.enhanced-table tbody tr.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.enhanced-table tbody tr.selected:hover {
    background: var(--primary-100);
}

/* Header Content */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    position: relative;
}

.header-text {
    font-weight: 600;
    color: var(--gray-700);
}

/* Sortable Headers */
.sortable-header {
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.sortable-header:hover {
    background: var(--gray-100);
}

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

.sort-indicator {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    transition: color var(--animation-duration-fast) var(--animation-easing);
}

.sortable-header[aria-sort="ascending"] .sort-indicator,
.sortable-header[aria-sort="descending"] .sort-indicator {
    color: var(--primary-color);
}

/* Draggable Headers */
.draggable-header {
    cursor: move;
}

.draggable-header.dragging {
    opacity: 0.5;
}

.draggable-header.drop-left {
    border-left: 3px solid var(--primary-color);
}

.draggable-header.drop-right {
    border-right: 3px solid var(--primary-color);
}

/* Column Filters */
.filter-container {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
}

.column-filter {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color var(--animation-duration-fast) var(--animation-easing);
}

.column-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.resize-handle:hover {
    background: var(--primary-color);
}

/* Selection Column */
.select-column {
    width: 40px;
    text-align: center;
}

.select-all,
.row-selector {
    cursor: pointer;
    transform: scale(1.1);
}

/* Cell Focus */
.enhanced-table td:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: var(--primary-light);
    position: relative;
    z-index: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-500);
}

.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--gray-300);
}

.empty-content h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--gray-600);
}

.empty-content p {
    margin: 0;
    font-size: 0.875rem;
}

/* Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-controls .btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    background: var(--surface-primary);
    color: var(--gray-600);
    transition: all var(--animation-duration-fast) var(--animation-easing);
}

.pagination-controls .btn:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.pagination-controls .btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Context Menu */
.table-context-menu {
    position: fixed;
    background: var(--surface-primary);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 160px;
    z-index: 1000;
    font-size: 0.875rem;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    text-align: left;
    color: var(--gray-700);
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.context-menu-item:hover {
    background: var(--gray-100);
}

.context-menu-item:disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}

.context-menu-item:disabled:hover {
    background: none;
}

.context-menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

/* Loading States */
.enhanced-table.loading {
    position: relative;
    pointer-events: none;
}

.enhanced-table.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* Responsive Design */
@media (max-width: 768px) {
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .table-info {
        justify-content: center;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .table-pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .enhanced-table {
        min-width: 600px;
    }
}

/* High Contrast Mode */
.high-contrast .enhanced-table th {
    background: var(--gray-900);
    color: var(--gray-100);
    border-color: var(--gray-100);
}

.high-contrast .enhanced-table td {
    border-color: var(--gray-600);
}

.high-contrast .enhanced-table tbody tr:hover {
    background: var(--gray-800);
}

.high-contrast .enhanced-table tbody tr.selected {
    background: var(--primary-color);
    color: white;
}

.high-contrast .column-filter {
    background: var(--gray-900);
    color: var(--gray-100);
    border-color: var(--gray-600);
}

/* Reduced Motion */
.reduced-motion .enhanced-table td,
.reduced-motion .sortable-header,
.reduced-motion .sort-indicator,
.reduced-motion .column-filter,
.reduced-motion .resize-handle,
.reduced-motion .pagination-controls .btn,
.reduced-motion .context-menu-item {
    transition: none;
}

/* Print Styles */
@media print {
    .enhanced-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .table-toolbar,
    .table-pagination {
        display: none;
    }
    
    .table-wrapper {
        overflow: visible;
        max-height: none;
    }
    
    .enhanced-table {
        font-size: 10pt;
    }
    
    .enhanced-table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .filter-container {
        display: none;
    }
    
    .resize-handle {
        display: none;
    }
}

/* Enhanced Search Styles */
.enhanced-search {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-primary);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    transition: border-color var(--animation-duration-fast) var(--animation-easing),
                box-shadow var(--animation-duration-fast) var(--animation-easing);
}

.search-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--gray-400);
    pointer-events: none;
}

.search-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    background: transparent;
    color: var(--gray-900);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.clear-search {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin-right: 0.25rem;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--animation-duration-fast) var(--animation-easing);
}

.clear-search:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.clear-search svg {
    width: 1rem;
    height: 1rem;
}

.search-loading {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    color: var(--primary-color);
}

.search-loading .spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: var(--surface-primary);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.suggestion-item {
    cursor: pointer;
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: var(--gray-50);
}

.suggestion-item.selected {
    background: var(--primary-light);
}

.suggestion-content {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
}

.suggestion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gray-400);
    flex-shrink: 0;
}

.suggestion-icon svg {
    width: 1rem;
    height: 1rem;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-main {
    font-size: 0.875rem;
    color: var(--gray-900);
    font-weight: 500;
}

.suggestion-main mark {
    background: var(--warning-light);
    color: var(--warning-dark);
    padding: 0;
    border-radius: 2px;
}

.suggestion-description {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.remove-from-history {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--gray-400);
    cursor: pointer;
    opacity: 0;
    transition: all var(--animation-duration-fast) var(--animation-easing);
}

.suggestion-item:hover .remove-from-history {
    opacity: 1;
}

.remove-from-history:hover {
    background: var(--gray-200);
    color: var(--gray-600);
}

.remove-from-history svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Search States */
.enhanced-search.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.enhanced-search.disabled .search-input-container {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

/* Suggestion Types */
.suggestion-item[data-type="history"] .suggestion-icon {
    color: var(--info-color);
}

.suggestion-item[data-type="person"] .suggestion-icon {
    color: var(--success-color);
}

.suggestion-item[data-type="company"] .suggestion-icon {
    color: var(--warning-color);
}

.suggestion-item[data-type="skill"] .suggestion-icon {
    color: var(--secondary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .enhanced-search {
        max-width: 100%;
    }
    
    .search-suggestions {
        margin-left: -1rem;
        margin-right: -1rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .suggestion-content {
        padding: 1rem;
    }
    
    .suggestions-list {
        max-height: 60vh;
    }
}

/* High Contrast Mode */
.high-contrast .search-input-container {
    border-width: 3px;
    border-color: var(--gray-900);
}

.high-contrast .search-input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color);
}

.high-contrast .search-suggestions {
    border-width: 2px;
    border-color: var(--gray-900);
}

.high-contrast .suggestion-item:hover,
.high-contrast .suggestion-item.selected {
    background: var(--gray-900);
    color: var(--gray-100);
}

.high-contrast .suggestion-main mark {
    background: var(--warning-color);
    color: var(--gray-900);
}

/* Reduced Motion */
.reduced-motion .search-input-container,
.reduced-motion .clear-search,
.reduced-motion .suggestion-item,
.reduced-motion .remove-from-history {
    transition: none;
}

.reduced-motion .search-loading .spinner {
    animation: none;
    border-top-color: var(--primary-color);
}

/* Focus Management */
.keyboard-navigation .suggestion-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Print Styles */
@media print {
    .search-suggestions {
        display: none !important;
    }
    
    .search-loading {
        display: none !important;
    }
    
    .clear-search {
        display: none !important;
    }
}

:root {
    /* Enhanced Brand Colors - Aligned with Tailwind Config */
    --primary-color: #3b82f6; /* primary-500 */
    --primary-hover: #2563eb; /* primary-600 */
    --primary-light: #dbeafe; /* primary-100 */
    --primary-dark: #1d4ed8; /* primary-700 */
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
    
    --secondary-color: #a855f7; /* secondary-500 */
    --secondary-hover: #9333ea; /* secondary-600 */
    --secondary-light: #f3e8ff; /* secondary-100 */
    --secondary-dark: #7c3aed; /* secondary-700 */
    
    --success-color: #10b981; /* success-500 */
    --success-hover: #059669; /* success-600 */
    --success-light: #d1fae5; /* success-100 */
    --success-dark: #047857; /* success-700 */
    
    --warning-color: #f59e0b; /* warning-500 */
    --warning-hover: #d97706; /* warning-600 */
    --warning-light: #fef3c7; /* warning-100 */
    --warning-dark: #b45309; /* warning-700 */
    
    --danger-color: #ef4444; /* danger-500 */
    --danger-hover: #dc2626; /* danger-600 */
    --danger-light: #fee2e2; /* danger-100 */
    --danger-dark: #b91c1c; /* danger-700 */
    
    --info-color: #0ea5e9; /* info-500 */
    --info-hover: #0284c7; /* info-600 */
    --info-light: #e0f2fe; /* info-100 */
    --info-dark: #0369a1; /* info-700 */
    
    /* Enhanced Neutrals with Better Contrast - Aligned with Tailwind Config */
    --gray-25: #fcfcfd;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gray-950: #020617;
    
    /* Surface Colors */
    --surface-primary: #ffffff;
    --surface-secondary: #f8fafc;
    --surface-overlay: rgba(0, 0, 0, 0.5);
    
    /* Accessibility Colors */
    --focus-ring: #3b82f6;
    --focus-ring-offset: #ffffff;
    
    /* Animation Variables */
    --animation-duration-fast: 150ms;
    --animation-duration-normal: 300ms;
    --animation-duration-slow: 500ms;
    --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Shadow System */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --surface-primary: #ffffff;
    --surface-secondary: var(--gray-25);
    --surface-elevated: #ffffff;
    --surface-overlay: rgba(15, 23, 42, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Consolas', 'Liberation Mono', 'Menlo', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Enhanced Premium Shadows - Aligned with Tailwind Config */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
    
    /* Colored Shadows for Premium Effect - Updated Colors */
    --shadow-primary: 0 10px 25px -5px rgb(59 130 246 / 0.15);
    --shadow-secondary: 0 10px 25px -5px rgb(168 85 247 / 0.15);
    --shadow-success: 0 10px 25px -5px rgb(16 185 129 / 0.15);
    --shadow-warning: 0 10px 25px -5px rgb(245 158 11 / 0.15);
    --shadow-danger: 0 10px 25px -5px rgb(239 68 68 / 0.15);
    
    /* Enhanced Border Radius */
    --radius-xs: 0.125rem;
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Enhanced Transitions and Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Backdrop Blur */
    --backdrop-blur: blur(8px);
    --backdrop-blur-sm: blur(4px);
    --backdrop-blur-lg: blur(16px);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 64px;
    
    /* Z-index layers */
    --z-sidebar-overlay: 2000;
    --z-sidebar: 2001;
    --z-toast: 2100;
}

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-md);
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin: 0 0 var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout - Modern Tailwind-first approach */
.app-container {
    /* Most layout handled by Tailwind classes in HTML */
}

/* Enhanced Premium Sidebar - Core styles not available in Tailwind */
.sidebar {
    /* Core positioning - handled by Tailwind classes */
    width: var(--sidebar-width);
    z-index: var(--z-sidebar);
    backdrop-filter: var(--backdrop-blur);
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Sidebar header - minimal custom styles */
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--gray-200) 50%, transparent 100%);
}

/* Logo - keeping only complex background-clip styles */
.logo {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (-webkit-background-clip: text) {
    .logo {
        color: var(--primary-color);
        background: none;
    }
}

/* Sidebar toggle - removed, handled by hamburger classes in HTML */

/* Navigation - replaced with Tailwind classes in HTML */
/* Only keeping complex active state indicator */
.nav-link.active::after {
    content: '';
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Sidebar footer - replaced with Tailwind classes in HTML */

/* Main content - simplified for Tailwind classes */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    z-index: -10;
    transition: left var(--transition-base);
}

/* Premium Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    min-width: 350px;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideInBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

@keyframes slideInBounce {
    0% {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translateX(-5%) scale(1.02);
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.toast.success::before {
    background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
}

.toast.error::before {
    background: linear-gradient(135deg, var(--danger-color) 0%, #ef4444 100%);
}

.toast.warning::before {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
}

.toast.info::before {
    background: linear-gradient(135deg, var(--info-color) 0%, #3b82f6 100%);
}

.toast-content {
    margin-left: var(--spacing-lg);
    flex: 1;
    font-weight: 500;
}

.toast-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--gray-900);
}

.toast-message {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: var(--spacing-sm);
}

/* Enhanced Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Grid utilities - removed, using Tailwind classes instead */

/* Dashboard Specific Layouts */
.dashboard {
    padding: var(--spacing-2xl) 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--gray-100);
    position: relative;
}

.dashboard-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
}

.dashboard-header h1 {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.03em;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.metrics-grid {
    margin-bottom: var(--spacing-2xl);
}

.charts-grid {
    margin-bottom: var(--spacing-2xl);
}

.tables-grid {
    margin-bottom: var(--spacing-2xl);
}

/* Flex utilities - removed, using Tailwind classes instead */

/* Premium Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse-scale 1.5s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.loading-dots {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.loading-dots .pulse-dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .pulse-dot:nth-child(3) { animation-delay: 0.4s; }

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-right {
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Accessibility */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced focus indicators for better accessibility */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.search-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Focus-visible for modern browsers */
:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Keep essential animations but make them instant */
    .loading-spinner {
        animation: none;
        border-color: var(--primary-color) transparent transparent transparent;
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Text utilities */
/* Text and font utilities - removed, using Tailwind classes instead */

/* Spacing utilities - removed, using Tailwind classes instead */

/* Display, width, height, gap, background, and padding utilities - removed, using Tailwind classes instead */

/* Modern Loading States - Enhanced with Tailwind compatibility */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: pulse-scale 1.5s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.loading-dots .pulse-dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dots .pulse-dot:nth-child(3) { animation-delay: 0.4s; }

/* Motion-safe animations */
@media (prefers-reduced-motion: reduce) {
    .skeleton,
    .loading-spinner,
    .pulse-dot {
        animation: none;
    }
    
    .loading-spinner {
        border-color: #3b82f6 #f1f5f9 #f1f5f9 #f1f5f9;
    }
}

/* Loading Overlay Styles */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
    animation: fadeIn 0.2s ease-out;
}

.loading-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md, 1rem);
    text-align: center;
}

.loading-overlay-text {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--gray-700, #374151);
}

/* Visually Hidden utility class for accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Import Toast Notification Styles */
@import url('./toast-notifications.css');