/* Custom CSS for Chiikawa Wallpaper Website */

/* Wallpaper Grid Layouts */
.wallpaper-grid {
    display: grid;
    gap: 1.5rem;
}

.mobile-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.desktop-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (min-width: 640px) {
    .mobile-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .desktop-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (min-width: 768px) {
    .mobile-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .desktop-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (min-width: 1024px) {
    .mobile-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .desktop-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* Tab Styles */
.tab-button, .tab-link {
    color: #6b7280;
    background-color: transparent;
}

.tab-button.active, .tab-link.active {
    color: #1f2937;
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.tab-button:hover, .tab-link:hover {
    color: #ea7c5c;
}

/* Wallpaper Item Hover Effects */
.wallpaper-item {
    transition: transform 0.2s ease-in-out;
}

.wallpaper-item:hover {
    transform: translateY(-2px);
}

.wallpaper-item img {
    transition: transform 0.3s ease-in-out;
}

.wallpaper-item:hover img {
    transform: scale(1.05);
}

/* Button Hover Effects */
.preview-btn, .download-btn {
    transition: all 0.2s ease-in-out;
    transform: translateY(10px);
    opacity: 0;
}

.wallpaper-item:hover .preview-btn,
.wallpaper-item:hover .download-btn {
    transform: translateY(0);
    opacity: 1;
}

/* Modal Styles */
#wallpaperModal {
    backdrop-filter: blur(4px);
}

#wallpaperModal .bg-white {
    max-width: 90vw;
    max-height: 90vh;
}

#wallpaperModal img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* FAQ Accordion */
.faq-button i {
    transition: transform 0.2s ease-in-out;
}

.faq-button[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Language Dropdown */
#languageDropdown {
    transition: all 0.2s ease-in-out;
}

#languageDropdown.hidden {
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#languageDropdown:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Menu */
#mobileMenu {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobileMenu.show {
    max-height: 400px;
}

/* Hero Section Animation */
.hero-animation {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger Animation for Grid Items */
.wallpaper-item {
    animation: fadeInScale 0.6s ease-out;
    animation-fill-mode: both;
}

.wallpaper-item:nth-child(1) { animation-delay: 0.1s; }
.wallpaper-item:nth-child(2) { animation-delay: 0.2s; }
.wallpaper-item:nth-child(3) { animation-delay: 0.3s; }
.wallpaper-item:nth-child(4) { animation-delay: 0.4s; }
.wallpaper-item:nth-child(5) { animation-delay: 0.5s; }
.wallpaper-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
.tab-button:focus,
.tab-link:focus,
button:focus,
a:focus {
    outline: 2px solid #ea7c5c;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print Styles */
@media print {
    .wallpaper-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .no-print {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wallpaper-item {
        border: 2px solid #000;
    }
    
    .tab-button.active,
    .tab-link.active {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .wallpaper-item:hover {
        transform: none;
    }
    
    .wallpaper-item:hover img {
        transform: none;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Will be implemented if needed */
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Error States */
.error-state {
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Success States */
.success-state {
    color: #10b981;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Utility Classes */
.aspect-ratio-mobile {
    aspect-ratio: 9/16;
}

.aspect-ratio-desktop {
    aspect-ratio: 16/9;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
}

/* SEO and Performance Optimizations */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
} 