/* ====================================
   SIDEBAR SKELETON LOADER STYLES
   ==================================== */

/* CSS Custom Properties για Δυναμική Διαχείριση */
:root {
    /* Skeleton Colors - Light Mode */
    --skeleton-bg-light: #e5e7eb;
    --skeleton-highlight-light: #f3f4f6;
    
    /* Skeleton Colors - Dark Mode */
    --skeleton-bg-dark: #374151;
    --skeleton-highlight-dark: #4b5563;
    
    /* Animation Timings */
    --shimmer-duration: 2s;
    --skeleton-radius: 0.25rem;
    
    /* Spacing and Sizing */
    --skeleton-line-height: 1rem;
    --skeleton-icon-size: 1.25rem; /* 5 in Tailwind = 1.25rem */
    --skeleton-gap: 0.375rem; /* 1.5 in Tailwind */
}

/* Dark mode overrides */
[data-mode="dark"] {
    --skeleton-bg: var(--skeleton-bg-dark);
    --skeleton-highlight: var(--skeleton-highlight-dark);
}

.dark {
    --skeleton-bg: var(--skeleton-bg-dark);
    --skeleton-highlight: var(--skeleton-highlight-dark);
}

/* Default light mode */
:root {
    --skeleton-bg: var(--skeleton-bg-light);
    --skeleton-highlight: var(--skeleton-highlight-light);
}

/* Shimmer Animation - Οριζόντιο gradient που κινείται */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Base shimmer effect - ΜΟΝΟ οριζόντιο */
.shimmer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        var(--skeleton-bg) 0%,
        var(--skeleton-highlight) 20%,
        var(--skeleton-bg) 40%,
        var(--skeleton-bg) 100%
    );
    background-size: 200% 100%;
    animation: shimmer var(--shimmer-duration) linear infinite;
    border-radius: var(--skeleton-radius);
    /* GPU Acceleration */
    will-change: background-position;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .shimmer {
        animation: none;
        background: var(--skeleton-bg);
    }
}

/* Skeleton line - for text placeholders */
.skeleton-line {
    display: inline-block;
    vertical-align: middle;
    min-height: var(--skeleton-line-height);
    min-width: 2rem;
}

/* Skeleton box - for icon placeholders */
.skeleton-box {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    border-radius: var(--skeleton-radius);
    width: var(--skeleton-icon-size);
    height: var(--skeleton-icon-size);
}

/* Skeleton circle - for avatar placeholders */
.skeleton-circle {
    display: inline-block;
    border-radius: 50%;
}

/* Skeleton title - for section headers */
.skeleton-title {
    display: inline-block;
    height: 1rem;
    min-width: 3rem;
    border-radius: var(--skeleton-radius);
}

/* Skeleton label - for menu items */
.skeleton-label {
    display: inline-block;
    height: 1rem;
    min-width: 4rem;
    max-width: 10rem;
    border-radius: var(--skeleton-radius);
}

/* Customer Portal Card skeleton background */
.skeleton-card-bg {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.dark .skeleton-card-bg,
[data-mode="dark"] .skeleton-card-bg {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

/* Fade-in animation for skeleton appearance - ΜΕ ΜΟΝΟ opacity */
@keyframes skeleton-fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.skeleton-fadein {
    animation: skeleton-fadein 0.3s ease-in forwards;
}

/* ====================================
   DASHBOARD SKELETON STYLES
   ==================================== */

.dashboard-card-skeleton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    min-height: 140px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark .dashboard-card-skeleton,
[data-mode="dark"] .dashboard-card-skeleton {
    background: #1e293b;
    border-color: #334155;
}

.dashboard-card-skeleton-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.dashboard-icon-skeleton {
    display: block;
    width: 4rem;
    height: 4rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.dashboard-label-skeleton {
    display: block;
    height: 0.875rem;
    border-radius: var(--skeleton-radius);
    max-width: 140px;
}

/* Staggered animation for dashboard cards */
.dashboard-card-skeleton:nth-child(1) { animation-delay: 0s; }
.dashboard-card-skeleton:nth-child(2) { animation-delay: 0.1s; }
.dashboard-card-skeleton:nth-child(3) { animation-delay: 0.2s; }
.dashboard-card-skeleton:nth-child(4) { animation-delay: 0.3s; }
.dashboard-card-skeleton:nth-child(5) { animation-delay: 0.4s; }
.dashboard-card-skeleton:nth-child(6) { animation-delay: 0.5s; }
.dashboard-card-skeleton:nth-child(7) { animation-delay: 0.6s; }
.dashboard-card-skeleton:nth-child(8) { animation-delay: 0.7s; }
.dashboard-card-skeleton:nth-child(9) { animation-delay: 0.8s; }
.dashboard-card-skeleton:nth-child(10) { animation-delay: 0.9s; }
.dashboard-card-skeleton:nth-child(11) { animation-delay: 1s; }
.dashboard-card-skeleton:nth-child(12) { animation-delay: 1.1s; }
.dashboard-card-skeleton:nth-child(13) { animation-delay: 1.2s; }
.dashboard-card-skeleton:nth-child(14) { animation-delay: 1.3s; }
.dashboard-card-skeleton:nth-child(15) { animation-delay: 1.4s; }
.dashboard-card-skeleton:nth-child(16) { animation-delay: 1.5s; }

/* Responsive breakpoints */
@media (min-width: 640px) {
    .dashboard-card-skeleton {
        padding: 1.25rem;
        min-height: 160px;
    }
    .dashboard-icon-skeleton {
        width: 5rem;
        height: 5rem;
    }
    .dashboard-label-skeleton {
        height: 0.9375rem;
    }
}

@media (min-width: 768px) {
    .dashboard-card-skeleton {
        padding: 1.8rem;
        min-height: 180px;
    }
    .dashboard-icon-skeleton {
        width: 6rem;
        height: 6rem;
    }
    .dashboard-label-skeleton {
        height: 1rem;
    }
}

/* ====================================
   SIDEBAR MENU SKELETON VARIATIONS
   ==================================== */

/* Menu item skeleton container */
.menu-item-skeleton {
    position: relative;
    overflow: hidden;
    animation: skeleton-fadein 0.3s ease-in forwards;
}

/* Staggered fade-in using specific item classes - Works regardless of section headers */
.skeleton-item-1 { animation-delay: 0s; }
.skeleton-item-2 { animation-delay: 0.05s; }
.skeleton-item-3 { animation-delay: 0.1s; }
.skeleton-item-4 { animation-delay: 0.15s; }
.skeleton-item-5 { animation-delay: 0.2s; }
.skeleton-item-6 { animation-delay: 0.25s; }
.skeleton-item-7 { animation-delay: 0.3s; }
.skeleton-item-8 { animation-delay: 0.35s; }
.skeleton-item-9 { animation-delay: 0.4s; }
.skeleton-item-10 { animation-delay: 0.45s; }
.skeleton-item-11 { animation-delay: 0.5s; }
.skeleton-item-12 { animation-delay: 0.55s; }
.skeleton-item-13 { animation-delay: 0.6s; }
.skeleton-item-14 { animation-delay: 0.65s; }
.skeleton-item-15 { animation-delay: 0.7s; }
.skeleton-item-16 { animation-delay: 0.75s; }
.skeleton-item-17 { animation-delay: 0.8s; }
.skeleton-item-18 { animation-delay: 0.85s; }
.skeleton-item-19 { animation-delay: 0.9s; }
.skeleton-item-20 { animation-delay: 0.95s; }

/* Variable width classes for natural appearance */
.skeleton-w-sm { width: 4rem; }
.skeleton-w-md { width: 6rem; }
.skeleton-w-lg { width: 8rem; }
.skeleton-w-xl { width: 10rem; }

/* Title width variations */
.skeleton-title-sm { width: 3rem; }
.skeleton-title-md { width: 4rem; }
.skeleton-title-lg { width: 5rem; }

/* Print styles - hide skeleton loaders */
@media print {
    .shimmer,
    .skeleton-line,
    .skeleton-box,
    .skeleton-circle,
    .skeleton-card-bg,
    .dashboard-card-skeleton,
    .menu-item-skeleton {
        display: none;
    }
}
