/* Custom styles - Sakura Theme */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar - Sakura */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf2f8;
}

::-webkit-scrollbar-thumb {
    background: #f9a8d4;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f472b6;
}

/* Card hover effect */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(244, 114, 182, 0.2);
}

/* Gradient background - Sakura */
.gradient-bg {
    background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 50%, #ec4899 100%);
}

/* Loading spinner - Sakura */
.spinner {
    border: 3px solid #fce7f3;
    border-top: 3px solid #ec4899;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button styles - Sakura */
.btn-primary {
    background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 50%, #ec4899 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

/* Form focus styles - Sakura */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #f472b6 !important;
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.2);
}

/* Table styles */
table {
    border-collapse: collapse;
}

/* Dropdown animation */
.group:hover .group-hover\:visible {
    visibility: visible;
    opacity: 1;
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Product image hover */
.product-image {
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

/* Status badges - Sakura theme */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #fce7f3;
    color: #9d174d;
}

/* Sakura specific styles */
.sakura-card {
    background: linear-gradient(135deg, rgba(253, 242, 248, 0.9) 0%, rgba(252, 231, 243, 0.9) 100%);
    border: 1px solid #fbcfe8;
    backdrop-filter: blur(10px);
}

.sakura-button {
    background: linear-gradient(135deg, #f9a8d4 0%, #f472b6 100%);
    color: white;
    transition: all 0.3s ease;
}

.sakura-button:hover {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

/* Floating sakura decoration */
.sakura-float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Selection color - Sakura */
::selection {
    background: #f9a8d4;
    color: #831843;
}


/* ==================== Lazy Loading Styles ==================== */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Placeholder shimmer effect */
.lazy-placeholder {
    background: linear-gradient(90deg, #fce7f3 25%, #fbcfe8 50%, #fce7f3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Global announcement marquee */
.global-announcement-bar {
    position: sticky;
    top: 56px;
    z-index: 40;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(180deg, rgba(253, 242, 248, 0.96) 0%, rgba(252, 231, 243, 0.92) 100%);
    border-bottom: 1px solid rgba(249, 168, 212, 0.35);
}

@media (min-width: 768px) {
    .global-announcement-bar {
        top: 64px;
    }
}

.global-announcement-marquee {
    position: relative;
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    border-bottom: 1px solid;
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.1);
    height: 2.35rem;
    border-radius: 9999px;
}

.global-announcement-track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: max-content;
    flex-wrap: nowrap;
    animation-name: global-marquee-scroll;
    animation-duration: var(--announcement-speed, 20s);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    height: 100%;
    padding: 0 1rem;
}

.global-announcement-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-right: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
}


@keyframes global-marquee-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (max-width: 640px) {
    .global-announcement-marquee {
        height: 2.2rem;
    }

    .global-announcement-item {
        font-size: 0.75rem;
        margin-right: 2rem;
    }
}

/* ==================== Performance Optimizations ==================== */
/* GPU acceleration for animations */
.card-hover,
.sakura-button,
.product-image,
.lazy-image {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .global-announcement-track {
        animation: none !important;
        transform: none !important;
        min-width: 100%;
        justify-content: center;
    }

    .global-announcement-item[aria-hidden='true'] {
        display: none;
    }

    .sakura-petal {
        display: none;
    }
}

/* ==================== Critical CSS Inline Styles ==================== */
/* These styles are critical for above-the-fold content */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==================== Image Optimization ==================== */
img {
    max-width: 100%;
    height: auto;
}

/* WebP fallback */
.no-webp .webp-image {
    display: none;
}

.webp .fallback-image {
    display: none;
}

/* ==================== Loading States ==================== */
.skeleton {
    background: linear-gradient(90deg, #fce7f3 25%, #fbcfe8 50%, #fce7f3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ==================== Print Styles ==================== */
@media print {
    .no-print,
    nav,
    footer,
    .sakura-container {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    a {
        text-decoration: underline;
    }
}
