/* Modern Skeleton Loaders for Recruit Platform */

/* Core Skeleton Animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, 
        #f1f5f9 25%, 
        #e2e8f0 50%, 
        #f1f5f9 75%
    );
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
}

/* Base skeleton line variations */
.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm, 4px);
}

.skeleton-line-sm { height: 10px; }
.skeleton-line-md { height: 14px; }
.skeleton-line-lg { height: 18px; }
.skeleton-line-xl { height: 24px; }

/* Width variations */
.skeleton-w-full { width: 100%; }
.skeleton-w-3-4 { width: 75%; }
.skeleton-w-1-2 { width: 50%; }
.skeleton-w-1-3 { width: 33.333%; }
.skeleton-w-1-4 { width: 25%; }

/* Candidate Card Skeleton */
.skeleton-candidate-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg, 1rem);
    padding: var(--spacing-xl, 1.5rem);
    background: white;
    border-radius: var(--radius-lg, 8px);
    border: 1px solid var(--gray-200, #e2e8f0);
    margin-bottom: var(--spacing-md, 1rem);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.skeleton-candidate-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full, 50%);
    flex-shrink: 0;
}

.skeleton-candidate-content {
    flex: 1;
    min-width: 0;
}

.skeleton-candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm, 0.5rem);
}

.skeleton-candidate-name {
    width: 200px;
    height: 20px;
    margin-bottom: var(--spacing-xs, 0.25rem);
}

.skeleton-candidate-role {
    width: 150px;
    height: 14px;
    margin-bottom: var(--spacing-md, 1rem);
}

.skeleton-candidate-skills {
    display: flex;
    gap: var(--spacing-sm, 0.5rem);
    margin-bottom: var(--spacing-md, 1rem);
    flex-wrap: wrap;
}

.skeleton-skill-tag {
    width: 80px;
    height: 28px;
    border-radius: var(--radius-full, 9999px);
}

.skeleton-candidate-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-lg, 1rem);
}

.skeleton-meta-item {
    width: 100px;
    height: 12px;
}

.skeleton-candidate-actions {
    display: flex;
    gap: var(--spacing-sm, 0.5rem);
    align-self: flex-start;
}

.skeleton-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md, 6px);
}

/* Dashboard Metric Card Skeleton */
.skeleton-metric-card {
    background: white;
    border-radius: var(--radius-xl, 12px);
    padding: var(--spacing-xl, 1.5rem);
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    position: relative;
    overflow: hidden;
}

.skeleton-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
}

.skeleton-metric-value {
    width: 120px;
    height: 48px;
    margin-bottom: var(--spacing-md, 1rem);
    border-radius: var(--radius-lg, 8px);
}

.skeleton-metric-label {
    width: 140px;
    height: 16px;
    margin-bottom: var(--spacing-lg, 1.5rem);
}

.skeleton-metric-change {
    width: 80px;
    height: 24px;
    border-radius: var(--radius-full, 9999px);
    margin-bottom: var(--spacing-md, 1rem);
}

.skeleton-sparkline {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-sm, 4px);
}

/* Data Table Skeleton */
.skeleton-table-container {
    background: white;
    border-radius: var(--radius-lg, 8px);
    border: 1px solid var(--gray-200, #e2e8f0);
    overflow: hidden;
}

.skeleton-table-header {
    display: flex;
    padding: var(--spacing-lg, 1rem);
    background: var(--gray-50, #f8fafc);
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
    gap: var(--spacing-lg, 1rem);
}

.skeleton-table-header-cell {
    height: 16px;
    border-radius: var(--radius-sm, 4px);
    flex: 1;
}

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

.skeleton-table-row {
    display: flex;
    padding: var(--spacing-lg, 1rem);
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
    gap: var(--spacing-lg, 1rem);
    align-items: center;
}

.skeleton-table-row:last-child {
    border-bottom: none;
}

.skeleton-table-cell {
    height: 14px;
    border-radius: var(--radius-sm, 4px);
    flex: 1;
}

/* Chart Placeholder Skeleton */
.skeleton-chart-container {
    background: white;
    border-radius: var(--radius-xl, 12px);
    padding: var(--spacing-xl, 1.5rem);
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    position: relative;
    overflow: hidden;
}

.skeleton-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
}

.skeleton-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl, 1.5rem);
}

.skeleton-chart-title {
    width: 180px;
    height: 20px;
}

.skeleton-chart-controls {
    width: 120px;
    height: 32px;
    border-radius: var(--radius-md, 6px);
}

.skeleton-chart-body {
    height: 300px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    padding: var(--spacing-lg, 1rem) 0;
    gap: var(--spacing-sm, 0.5rem);
}

.skeleton-chart-bar {
    flex: 1;
    border-radius: var(--radius-sm, 4px) var(--radius-sm, 4px) 0 0;
    min-height: 40px;
    max-width: 40px;
}

/* Generate varying heights for chart bars */
.skeleton-chart-bar:nth-child(1) { height: 60%; }
.skeleton-chart-bar:nth-child(2) { height: 80%; }
.skeleton-chart-bar:nth-child(3) { height: 45%; }
.skeleton-chart-bar:nth-child(4) { height: 90%; }
.skeleton-chart-bar:nth-child(5) { height: 70%; }
.skeleton-chart-bar:nth-child(6) { height: 55%; }
.skeleton-chart-bar:nth-child(7) { height: 85%; }
.skeleton-chart-bar:nth-child(8) { height: 40%; }

.skeleton-chart-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg, 1rem);
    margin-top: var(--spacing-lg, 1rem);
    padding-top: var(--spacing-lg, 1rem);
    border-top: 1px solid var(--gray-100, #f1f5f9);
}

.skeleton-legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 0.5rem);
}

.skeleton-legend-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm, 4px);
}

.skeleton-legend-text {
    width: 60px;
    height: 12px;
}

/* Search Results Skeleton */
.skeleton-search-results {
    background: white;
    border-radius: var(--radius-lg, 8px);
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    overflow: hidden;
}

.skeleton-search-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md, 1rem);
    padding: var(--spacing-lg, 1rem);
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
}

.skeleton-search-item:last-child {
    border-bottom: none;
}

.skeleton-search-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm, 4px);
    flex-shrink: 0;
}

.skeleton-search-content {
    flex: 1;
}

.skeleton-search-title {
    width: 200px;
    height: 16px;
    margin-bottom: var(--spacing-xs, 0.25rem);
}

.skeleton-search-description {
    width: 300px;
    height: 12px;
}

/* Profile Skeleton */
.skeleton-profile {
    background: white;
    border-radius: var(--radius-xl, 12px);
    padding: var(--spacing-2xl, 2rem);
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.skeleton-profile-header {
    display: flex;
    gap: var(--spacing-xl, 1.5rem);
    margin-bottom: var(--spacing-2xl, 2rem);
    align-items: flex-start;
}

.skeleton-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full, 50%);
    flex-shrink: 0;
}

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

.skeleton-profile-name {
    width: 250px;
    height: 32px;
    margin-bottom: var(--spacing-md, 1rem);
    border-radius: var(--radius-lg, 8px);
}

.skeleton-profile-title {
    width: 200px;
    height: 20px;
    margin-bottom: var(--spacing-lg, 1rem);
}

.skeleton-profile-meta {
    display: flex;
    gap: var(--spacing-xl, 1.5rem);
    margin-bottom: var(--spacing-lg, 1rem);
}

.skeleton-profile-meta-item {
    width: 120px;
    height: 14px;
}

.skeleton-profile-actions {
    display: flex;
    gap: var(--spacing-md, 1rem);
}

.skeleton-profile-btn {
    width: 100px;
    height: 40px;
    border-radius: var(--radius-lg, 8px);
}

.skeleton-profile-sections {
    display: grid;
    gap: var(--spacing-xl, 1.5rem);
}

.skeleton-profile-section {
    padding: var(--spacing-lg, 1rem);
    background: var(--gray-50, #f8fafc);
    border-radius: var(--radius-lg, 8px);
}

.skeleton-section-title {
    width: 150px;
    height: 20px;
    margin-bottom: var(--spacing-lg, 1rem);
}

.skeleton-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 1rem);
}

.skeleton-section-item {
    width: 100%;
    height: 14px;
}

/* Loading Container with Screen Reader Support */
.skeleton-container {
    position: relative;
}

.skeleton-container[aria-label]::before {
    content: attr(aria-label);
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Progress Indicators for Bulk Operations */
.skeleton-progress-container {
    background: white;
    border-radius: var(--radius-lg, 8px);
    padding: var(--spacing-xl, 1.5rem);
    border: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.skeleton-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg, 1rem);
}

.skeleton-progress-title {
    width: 200px;
    height: 20px;
}

.skeleton-progress-percentage {
    width: 60px;
    height: 16px;
}

.skeleton-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200, #e2e8f0);
    border-radius: var(--radius-full, 9999px);
    overflow: hidden;
    margin-bottom: var(--spacing-lg, 1rem);
}

.skeleton-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
    border-radius: var(--radius-full, 9999px);
    animation: skeleton-progress 2s ease-in-out infinite;
}

@keyframes skeleton-progress {
    0%, 100% { width: 20%; }
    50% { width: 80%; }
}

.skeleton-progress-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md, 1rem);
}

.skeleton-progress-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md, 1rem);
}

.skeleton-step-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full, 50%);
    flex-shrink: 0;
}

.skeleton-step-text {
    width: 180px;
    height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .skeleton-candidate-card {
        flex-direction: column;
        gap: var(--spacing-md, 1rem);
    }
    
    .skeleton-candidate-avatar {
        align-self: center;
    }
    
    .skeleton-candidate-meta {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm, 0.5rem);
    }
    
    .skeleton-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .skeleton-chart-body {
        height: 200px;
    }
    
    .skeleton-table-header,
    .skeleton-table-row {
        padding: var(--spacing-md, 1rem);
        gap: var(--spacing-md, 1rem);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .skeleton {
        background: linear-gradient(90deg, 
            #000000 25%, 
            #333333 50%, 
            #000000 75%
        );
    }
    
    .skeleton-candidate-card,
    .skeleton-metric-card,
    .skeleton-chart-container,
    .skeleton-table-container,
    .skeleton-profile,
    .skeleton-progress-container {
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .skeleton,
    .skeleton-progress-fill {
        animation: none;
    }
    
    .skeleton {
        background: var(--gray-200, #e2e8f0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, 
            #1e293b 25%, 
            #334155 50%, 
            #1e293b 75%
        );
    }
    
    .skeleton-candidate-card,
    .skeleton-metric-card,
    .skeleton-chart-container,
    .skeleton-table-container,
    .skeleton-profile,
    .skeleton-progress-container {
        background: #0f172a;
        border-color: #334155;
    }
    
    .skeleton-table-header,
    .skeleton-profile-section {
        background: #1e293b;
    }
}

/* Dashboard Specific Styles */
.funnel-stage,
.source-item,
.skill-item {
    margin-bottom: 0.75rem;
}

.stage-bar,
.source-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    color: white;
    font-weight: 500;
    min-height: 40px;
    transition: all 0.3s ease;
    animation: slideInRight 0.6s ease-out forwards;
    transform: translateX(-20px);
    opacity: 0;
}

.stage-bar:hover,
.source-bar:hover {
    transform: translateX(0) scale(1.02);
    opacity: 1;
}

.skill-item {
    animation: slideInLeft 0.6s ease-out forwards;
    transform: translateX(-20px);
    opacity: 0;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.skill-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
    animation: fillBar 0.8s ease-out forwards;
}

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

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

/* Enhanced fade-in animation */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Demo Page Candidate Card Styles */
.candidate-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 1rem;
}

.candidate-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
}

.candidate-content {
    flex: 1;
    min-width: 0;
}

.candidate-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #1f2937;
}

.candidate-role {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
}

.candidate-skills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.skill-tag {
    padding: 0.25rem 0.75rem;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Additional metric card styles for demo */
.metric-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 1rem;
}

.metric-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
}

.metric-change.positive {
    background: #dcfce7;
    color: #166534;
}

.metric-change.negative {
    background: #fee2e2;
    color: #dc2626;
}

/* Card styles for demo */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #1f2937;
}

/* Table styles for demo */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Badge styles for demo */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Search result item for demo */
.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.search-result-item p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}