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

/* CSS Variables */
:root {
    --fsp-bg-color: #ffffff;
    --fsp-shimmer-color: #f0f0f0;
    --fsp-accent-color: #2ea3f2;
    --fsp-animation-speed: 1.5s;
}

/* Preloader container - full screen overlay */
#fsp-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--fsp-bg-color);
    z-index: 999999;
    overflow-y: auto;
    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: 1400px;
    width: 100%;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* 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,
        var(--fsp-shimmer-color) 0%,
        color-mix(in srgb, var(--fsp-shimmer-color) 80%, black) 20%,
        var(--fsp-shimmer-color) 40%,
        var(--fsp-shimmer-color) 100%
    );
    background-size: 200% 100%;
    animation: fsp-shimmer var(--fsp-animation-speed) ease-in-out infinite;
    border-radius: 8px;
    margin: 0 auto 15px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    body.fsp-reduced-motion .fsp-shimmer-box,
    body.fsp-reduced-motion .fsp-shimmer-accent,
    body.fsp-reduced-motion .fsp-loading-text {
        animation: none !important;
    }
}

/* Navbar Skeleton */
.fsp-shimmer-navbar {
    width: 100%;
    padding: 20px 0;
    margin: 0;
    background-color: var(--fsp-bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.fsp-shimmer-navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Logo */
.fsp-shimmer-navbar-logo {
    flex-shrink: 0;
}

.fsp-shimmer-navbar-logo img {
    max-height: 50px;
    height: auto;
    width: auto;
    max-width: 180px;
}

.fsp-shimmer-logo-placeholder {
    width: 120px;
    height: 40px;
    margin: 0;
}

/* Menu Items */
.fsp-shimmer-navbar-menu {
    display: flex;
    align-items: center;
    gap: 25px;
    flex: 1;
    justify-content: center;
}

.fsp-shimmer-menu-item {
    width: 80px;
    height: 16px;
    margin: 0;
    border-radius: 4px;
}

.fsp-shimmer-menu-item:nth-child(2) {
    width: 100px;
}

.fsp-shimmer-menu-item:nth-child(3) {
    width: 70px;
}

.fsp-shimmer-menu-item:nth-child(4) {
    width: 90px;
}

.fsp-shimmer-menu-item:nth-child(5) {
    width: 85px;
}

/* Navbar Actions (Right Side) */
.fsp-shimmer-navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.fsp-shimmer-action-button {
    width: 100px;
    height: 36px;
    margin: 0;
    border-radius: 6px;
}

.fsp-shimmer-action-icon {
    width: 36px;
    height: 36px;
    margin: 0;
    border-radius: 50%;
}

/* Mobile Navbar - hide menu items, show hamburger */
@media screen and (max-width: 980px) {
    .fsp-shimmer-navbar-menu {
        display: none;
    }

    .fsp-shimmer-navbar-actions .fsp-shimmer-action-button {
        display: none;
    }

    .fsp-shimmer-navbar-actions::before {
        content: '';
        display: block;
        width: 30px;
        height: 24px;
        background: linear-gradient(
            to bottom,
            var(--fsp-shimmer-color) 0%,
            var(--fsp-shimmer-color) 20%,
            transparent 20%,
            transparent 40%,
            var(--fsp-shimmer-color) 40%,
            var(--fsp-shimmer-color) 60%,
            transparent 60%,
            transparent 80%,
            var(--fsp-shimmer-color) 80%,
            var(--fsp-shimmer-color) 100%
        );
        animation: fsp-shimmer var(--fsp-animation-speed) ease-in-out infinite;
    }
}

/* 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: 100px;
    margin-bottom: 50px;
    padding: 80px 60px;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.fsp-shimmer-hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Title */
.fsp-shimmer-hero .fsp-shimmer-title {
    height: 60px;
    width: 85%;
    margin: 0 0 30px 0;
    border-radius: 8px;
}

/* Hero Description Lines */
.fsp-shimmer-hero .fsp-shimmer-line {
    height: 18px;
    width: 100%;
    margin: 0 0 15px 0;
    border-radius: 4px;
}

.fsp-shimmer-hero .fsp-shimmer-line.short {
    width: 70%;
    margin: 0 0 40px 0;
}

/* Hero Buttons */
.fsp-shimmer-buttons {
    display: flex;
    gap: 20px;
    margin: 0;
}

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

/* Hero Image */
.fsp-shimmer-hero-image {
    height: 450px;
    width: 100%;
    border-radius: 12px;
    align-self: center;
    justify-self: end;
    margin-left: auto;
}

/* Hero Tablet Responsive */
@media screen and (max-width: 980px) {
    .fsp-shimmer-hero {
        grid-template-columns: 1fr;
        gap: 50px;
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .fsp-shimmer-hero .fsp-shimmer-title {
        width: 100%;
        height: 50px;
        margin: 0 0 25px 0;
    }

    .fsp-shimmer-hero .fsp-shimmer-line {
        height: 16px;
        margin: 0 0 12px 0;
    }

    .fsp-shimmer-hero .fsp-shimmer-line.short {
        width: 85%;
        margin: 0 0 30px 0;
    }

    .fsp-shimmer-buttons {
        gap: 15px;
        flex-wrap: wrap;
    }

    .fsp-shimmer-button {
        height: 45px;
        width: 140px;
    }

    .fsp-shimmer-hero-image {
        height: 300px;
        order: -1; /* Show image first on mobile */
    }
}

/* Content sections */
.fsp-shimmer-section {
    margin-bottom: 60px;
    padding: 0 60px;
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media screen and (min-width: 1440px) {
    .fsp-shimmer-section,
    .fsp-shimmer-hero {
        padding-left: 80px;
        padding-right: 80px;
    }

    .fsp-shimmer-cards {
        gap: 50px;
    }

    .fsp-shimmer-hero {
        gap: 120px;
    }

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

@media screen and (min-width: 1920px) {
    .fsp-shimmer-section,
    .fsp-shimmer-hero {
        padding-left: 120px;
        padding-right: 120px;
    }

    .fsp-shimmer-cards {
        gap: 60px;
    }

    .fsp-shimmer-hero {
        gap: 150px;
    }

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

.fsp-shimmer-section-title {
    height: 40px;
    width: 250px;
    margin: 0 0 35px 0;
    border-radius: 6px;
}

/* Card grid */
.fsp-shimmer-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    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: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.fsp-shimmer-card-title {
    height: 48px;
    width: 100%;
    margin: 0;
    border-radius: 6px;
}

.fsp-shimmer-card-text {
    height: 60px;
    width: 100%;
    margin: 0;
    border-radius: 4px;
}

/* 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, var(--fsp-accent-color), color-mix(in srgb, var(--fsp-accent-color) 80%, black));
    margin: 50px auto 30px;
    border-radius: 2px;
    animation: fsp-pulse var(--fsp-animation-speed) ease-in-out infinite;
}

.fsp-shimmer-accent {
    animation: fsp-pulse var(--fsp-animation-speed) ease-in-out infinite;
}

/* Loading text */
.fsp-loading-text {
    text-align: center;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 16px;
    color: var(--fsp-accent-color);
    font-weight: 500;
    margin-top: 20px;
    margin-bottom: 60px;
    padding: 0 40px;
    animation: fsp-fade-pulse var(--fsp-animation-speed) 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(2, 1fr);
        gap: 30px;
    }

    .fsp-shimmer-section {
        padding: 0 40px;
    }

    .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: 100%;
        padding: 0;
    }

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

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

    .fsp-shimmer-hero {
        padding-top: 40px;
        padding-bottom: 40px;
        gap: 40px;
    }

    .fsp-shimmer-hero .fsp-shimmer-title {
        height: 45px;
        margin: 0 0 20px 0;
    }

    .fsp-shimmer-hero .fsp-shimmer-line {
        height: 14px;
        margin: 0 0 10px 0;
    }

    .fsp-shimmer-hero .fsp-shimmer-line.short {
        width: 90%;
        margin: 0 0 25px 0;
    }

    .fsp-shimmer-buttons {
        gap: 12px;
    }

    .fsp-shimmer-button {
        height: 42px;
        width: 130px;
        font-size: 14px;
    }

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

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

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

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

    .fsp-shimmer-section {
        padding: 0 20px;
    }

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

/* 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;
}

/* ============================================
   BLOG POST SKELETON STYLES
   ============================================ */

.fsp-shimmer-blog-post {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

/* Breadcrumb */
.fsp-shimmer-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-top: 20px;
}

.fsp-shimmer-breadcrumb-item {
    width: 60px;
    height: 12px;
    margin: 0;
    border-radius: 3px;
}

.fsp-shimmer-breadcrumb-item:nth-child(2) {
    width: 80px;
}

.fsp-shimmer-breadcrumb-item:nth-child(3) {
    width: 100px;
}

/* Post Header */
.fsp-shimmer-post-header {
    text-align: center;
    margin-bottom: 40px;
}

.fsp-shimmer-post-category {
    width: 100px;
    height: 24px;
    margin: 0 auto 20px;
    border-radius: 20px;
}

.fsp-shimmer-post-title {
    width: 100%;
    height: 48px;
    margin: 0 auto 15px;
    border-radius: 8px;
}

.fsp-shimmer-post-title.short {
    width: 60%;
    height: 48px;
}

/* Post Meta */
.fsp-shimmer-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.fsp-shimmer-meta-avatar {
    width: 40px;
    height: 40px;
    margin: 0;
    border-radius: 50%;
}

.fsp-shimmer-meta-text {
    width: 80px;
    height: 14px;
    margin: 0;
    border-radius: 4px;
}

.fsp-shimmer-meta-text:nth-child(3) {
    width: 60px;
}

.fsp-shimmer-meta-text:nth-child(4) {
    width: 70px;
}

/* Featured Image */
.fsp-shimmer-post-featured-image {
    width: 100%;
    height: 500px;
    margin: 0 0 50px 0;
    border-radius: 12px;
}

/* Post Content */
.fsp-shimmer-post-content {
    max-width: 750px;
    margin: 0 auto;
}

.fsp-shimmer-paragraph {
    width: 100%;
    height: 80px;
    margin: 0 0 20px 0;
    border-radius: 6px;
}

.fsp-shimmer-paragraph.short {
    width: 75%;
    height: 60px;
}

.fsp-shimmer-subheading {
    width: 60%;
    height: 32px;
    margin: 40px 0 25px 0;
    border-radius: 6px;
}

/* Quote Block */
.fsp-shimmer-quote {
    margin: 40px 0;
    padding: 30px;
    border-left: 4px solid var(--fsp-accent-color);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 8px 8px 0;
}

.fsp-shimmer-quote-text {
    width: 100%;
    height: 24px;
    margin: 0 0 15px 0;
    border-radius: 4px;
}

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

/* Post Footer - Tags & Share */
.fsp-shimmer-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.fsp-shimmer-tags {
    display: flex;
    gap: 10px;
}

.fsp-shimmer-tag {
    width: 70px;
    height: 28px;
    margin: 0;
    border-radius: 14px;
}

.fsp-shimmer-tag:nth-child(2) {
    width: 90px;
}

.fsp-shimmer-tag:nth-child(3) {
    width: 60px;
}

.fsp-shimmer-share {
    display: flex;
    gap: 10px;
}

.fsp-shimmer-share-button {
    width: 40px;
    height: 40px;
    margin: 0;
    border-radius: 50%;
}

/* Related Posts */
.fsp-shimmer-related {
    margin-top: 80px;
    padding-top: 50px;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

.fsp-shimmer-related-title {
    width: 200px;
    height: 32px;
    margin: 0 0 30px 0;
    border-radius: 6px;
}

.fsp-shimmer-related-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.fsp-shimmer-related-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fsp-shimmer-related-image {
    width: 100%;
    height: 180px;
    margin: 0;
    border-radius: 8px;
}

.fsp-shimmer-related-card-title {
    width: 100%;
    height: 50px;
    margin: 0;
    border-radius: 6px;
}

/* Blog Post Mobile Responsive */
@media screen and (max-width: 768px) {
    .fsp-shimmer-blog-post {
        padding: 0 20px 40px;
    }

    .fsp-shimmer-post-title,
    .fsp-shimmer-post-title.short {
        height: 36px;
        width: 100%;
    }

    .fsp-shimmer-post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

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

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

    .fsp-shimmer-subheading {
        height: 24px;
        width: 80%;
    }

    .fsp-shimmer-quote {
        padding: 20px;
        margin: 30px 0;
    }

    .fsp-shimmer-post-footer {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .fsp-shimmer-related-posts {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .fsp-shimmer-related-image {
        height: 200px;
    }
}
