/**
 * Fahmawy Shimmer Preloader Styles
 * Version: 1.0.0
 */

/* Preloader container - full screen overlay */
#fsp-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#fsp-preloader.fsp-loaded {
    opacity: 0;
    visibility: hidden;
}

/* Loader wrapper */
.fsp-loader-wrap {
    max-width: 1080px;
    width: 90%;
    margin: 0 auto;
    padding: 20px;
}

/* Logo styling */
.fsp-logo {
    text-align: center;
    margin-bottom: 40px;
    animation: fsp-fade-in 0.6s ease-in;
}

.fsp-logo img {
    max-width: 200px;
    height: auto;
    display: inline-block;
}

/* Shimmer skeleton elements */
.fsp-shimmer-box {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: fsp-shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
    margin: 0 auto 15px;
}

/* Header skeleton */
.fsp-shimmer-header {
    height: 80px;
    width: 100%;
    margin-bottom: 30px;
    border-radius: 0;
}

/* Navigation skeleton */
.fsp-shimmer-nav {
    height: 50px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 0;
}

/* Hero section skeletons */
.fsp-shimmer-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    padding: 60px 0;
}

.fsp-shimmer-hero-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fsp-shimmer-title {
    height: 60px;
    width: 80%;
}

.fsp-shimmer-line {
    height: 20px;
    width: 100%;
}

.fsp-shimmer-line.short {
    width: 70%;
}

.fsp-shimmer-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.fsp-shimmer-button {
    height: 50px;
    width: 150px;
    border-radius: 25px;
}

.fsp-shimmer-hero-image {
    height: 400px;
    width: 100%;
    border-radius: 12px;
}

/* Content sections */
.fsp-shimmer-section {
    margin-bottom: 60px;
}

.fsp-shimmer-section-title {
    height: 40px;
    width: 250px;
    margin-bottom: 30px;
}

/* Card grid */
.fsp-shimmer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.fsp-shimmer-card {
    background: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.fsp-shimmer-card-image {
    height: 200px;
    width: 100%;
    border-radius: 0;
    margin: 0;
}

.fsp-shimmer-card-content {
    padding: 20px;
}

.fsp-shimmer-card-category {
    height: 20px;
    width: 80px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.fsp-shimmer-card-title {
    height: 24px;
    width: 100%;
    margin-bottom: 10px;
}

.fsp-shimmer-card-text {
    height: 16px;
    width: 90%;
}

/* Footer skeleton */
.fsp-shimmer-footer {
    height: 200px;
    width: 100%;
    margin-top: 80px;
    border-radius: 0;
}

/* Accent bar with brand color */
.fsp-accent-bar {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #2ea3f2, #1e88d6);
    margin: 30px auto;
    border-radius: 2px;
    animation: fsp-pulse 1.5s ease-in-out infinite;
}

/* Loading text */
.fsp-loading-text {
    text-align: center;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 16px;
    color: #666;
    font-weight: 500;
    margin-top: 20px;
    animation: fsp-fade-pulse 1.5s ease-in-out infinite;
}

/* Shimmer animation */
@keyframes fsp-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Fade in animation */
@keyframes fsp-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation */
@keyframes fsp-pulse {
    0%, 100% {
        opacity: 1;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.7;
        transform: scaleX(1.1);
    }
}

/* Fade pulse animation */
@keyframes fsp-fade-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 980px) {
    .fsp-shimmer-hero {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 0;
    }

    .fsp-shimmer-hero-image {
        height: 300px;
    }

    .fsp-shimmer-cards {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .fsp-shimmer-title {
        height: 50px;
        width: 90%;
    }

    .fsp-shimmer-buttons {
        flex-direction: column;
    }

    .fsp-shimmer-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .fsp-loader-wrap {
        width: 95%;
        padding: 15px;
    }

    .fsp-logo img {
        max-width: 150px;
    }

    .fsp-shimmer-header {
        height: 60px;
    }

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

    .fsp-shimmer-card-image {
        height: 180px;
    }

    .fsp-shimmer-hero-image {
        height: 250px;
    }

    .fsp-loading-text {
        font-size: 14px;
    }
}

/* Custom properties for dynamic colors */
:root {
    --fsp-bg-color: #ffffff;
    --fsp-shimmer-color: #f0f0f0;
    --fsp-accent-color: #2ea3f2;
}

/* Apply custom colors */
#fsp-preloader {
    background-color: var(--fsp-bg-color);
}

.fsp-shimmer-box {
    background: linear-gradient(
        90deg,
        var(--fsp-shimmer-color) 0%,
        #e0e0e0 20%,
        var(--fsp-shimmer-color) 40%,
        var(--fsp-shimmer-color) 100%
    );
    background-size: 200% 100%;
}

.fsp-accent-bar {
    background: linear-gradient(90deg, var(--fsp-accent-color), var(--fsp-accent-color));
    filter: brightness(0.9);
}

/* Smooth page transition */
body {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

body.fsp-loading {
    overflow: hidden;
}
