/* 
 * Skeleton Screen Styles for Blazor WASM Loading
 * Provides a smooth loading experience while the application initializes
 */

/* Skeleton Wrapper */
.skeleton-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #f9fafb;
    overflow: hidden;
    z-index: 9999;
}

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

/* Header Skeleton */
.skeleton-header {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.skeleton-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.skeleton-menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-logo {
    width: 120px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-search {
    width: 200px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Main Content Skeleton */
.skeleton-main {
    display: flex;
    height: calc(100vh - 64px);
}

/* Sidebar Skeleton */
.skeleton-sidebar {
    width: 250px;
    background-color: #1a1d29;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-sidebar-logo {
    width: 150px;
    height: 100px;
    border-radius: 8px;
    margin: 0 auto 24px;
    background: linear-gradient(90deg, #2a2d39 0px, #34374a 40px, #2a2d39 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-menu-item {
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(90deg, #2a2d39 0px, #34374a 40px, #2a2d39 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Content Area Skeleton */
.skeleton-content {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
}

.skeleton-title {
    width: 300px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 32px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Cards Skeleton */
.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.skeleton-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-card-header {
    width: 60%;
    height: 24px;
    border-radius: 6px;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-card-body {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Table Skeleton */
.skeleton-table {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-table-row {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(90deg, #e5e7eb 0px, #f3f4f6 40px, #e5e7eb 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Loading Text with Spinner */
.skeleton-loading-text {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background-color: #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    color: #10B981;
    font-size: 14px;
    z-index: 10000;
}

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

.skeleton-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #e5e7eb;
    border-top-color: #10B981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .skeleton-sidebar {
        display: none;
    }

    .skeleton-content {
        padding: 16px;
    }

    .skeleton-search {
        display: none;
    }

    .skeleton-cards {
        grid-template-columns: 1fr;
    }

    .skeleton-header {
        padding: 0 16px;
    }

    .skeleton-loading-text {
        bottom: 20px;
        font-size: 12px;
        padding: 10px 20px;
    }

    .skeleton-spinner {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
}

/* Tablet Design */
@media (max-width: 1024px) {
    .skeleton-sidebar {
        width: 200px;
    }

    .skeleton-content {
        padding: 24px;
    }
}

/* Fade out animation when Blazor loads */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.skeleton-wrapper.loaded {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ============================================
   PUBLIC LOADING SCREEN (Home/Landing Page)
   Clean white background with centered pulsing logo
   ============================================ */

.public-loading-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 9999;
    overflow: hidden;
}

/* Subtle animated background circles */
.public-loading-wrapper::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(62, 172, 168, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: -300px;
    right: -300px;
    animation: float 10s ease-in-out infinite;
}

.public-loading-wrapper::after {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(44, 62, 80, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -250px;
    left: -250px;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(40px, -40px) scale(1.05);
    }
}

/* Logo Container - Centered with top 50% */
.public-loading-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Logo Image with Pulse Animation */
.public-logo-image {
    width: 240px;
    height: 240px;
    margin-top: -120px; /* Half of height to center perfectly */
    object-fit: contain;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 10px 30px rgba(62, 172, 168, 0.25));
}

/* Pulse Animation for Logo */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Responsive Design for Public Loading */
@media (max-width: 768px) {
    .public-logo-image {
        width: 180px;
        height: 180px;
        margin-top: -90px; /* Half of height */
    }

    .public-loading-wrapper::before {
        width: 500px;
        height: 500px;
        top: -200px;
        right: -200px;
    }

    .public-loading-wrapper::after {
        width: 450px;
        height: 450px;
        bottom: -180px;
        left: -180px;
    }
}

@media (max-width: 480px) {
    .public-logo-image {
        width: 140px;
        height: 140px;
        margin-top: -70px; /* Half of height */
    }

    .public-loading-wrapper::before {
        width: 350px;
        height: 350px;
        top: -150px;
        right: -150px;
    }

    .public-loading-wrapper::after {
        width: 300px;
        height: 300px;
        bottom: -120px;
        left: -120px;
    }
}
