/* Custom Styles for Ghibli Images Generator */

/* Global Styles */
:root {
    --primary-color: #4F46E5;
    --secondary-color: #8B5CF6;
    --accent-color: #EC4899;
    --background-light: #F9F3EC;
    --text-dark: #1F2937;
    --text-light: #F9FAFB;
}

body {
    background-color: var(--background-light);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

/* Ghibli-inspired elements */
.ghibli-cloud {
    position: absolute;
    opacity: 0.7;
    animation: float 15s infinite ease-in-out;
}

.ghibli-cloud-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.ghibli-cloud-2 {
    top: 15%;
    right: 10%;
    animation-delay: 2s;
}

.ghibli-cloud-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Hero Section Enhancements */
#hero {
    position: relative;
    overflow: hidden;
}

/* Image Converter Section */
#converter {
    position: relative;
    z-index: 1;
}

#upload-area {
    transition: all 0.3s ease;
}

#upload-area:hover {
    background-color: rgba(219, 234, 254, 0.5);
}

/* Gallery Section */
.gallery-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.gallery-item {
    flex: 0 0 auto;
    width: calc(100% / 1); /* 1 item per row on mobile */
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    aspect-ratio: 3/4;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

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

/* Responsive gallery image sizes */
@media (min-width: 640px) {
    .gallery-item {
        width: calc(100% / 2 - 12px); /* 2 items per row on small screens */
        aspect-ratio: 1/1;
    }
}

@media (min-width: 768px) {
    .gallery-item {
        width: calc(100% / 3 - 16px); /* 3 items per row on medium screens */
        aspect-ratio: 4/5;
    }
}

@media (min-width: 1024px) {
    .gallery-item {
        width: calc(100% / 4 - 18px); /* 4 items per row on large screens */
        aspect-ratio: 3/4;
    }
}

/* Comments Carousel */
.comment-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 350px;
    margin: 0 1rem;
    flex-shrink: 0;
}

.comments-track {
    display: flex;
    transition: transform 0.5s ease;
}

/* Custom Button Styles */
.btn-ghibli {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
}

.btn-ghibli:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(79, 70, 229, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .comment-card {
        max-width: 300px;
    }
    
    .comments-carousel {
        padding: 0 1rem;
    }
    
    #prev-comment, #next-comment {
        top: calc(50% - 1rem);
    }
}

/* Loading Animation */
.loading-animation {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-animation div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-animation div:nth-child(1) {
    left: 8px;
    animation: loading1 0.6s infinite;
}

.loading-animation div:nth-child(2) {
    left: 8px;
    animation: loading2 0.6s infinite;
}

.loading-animation div:nth-child(3) {
    left: 32px;
    animation: loading2 0.6s infinite;
}

.loading-animation div:nth-child(4) {
    left: 56px;
    animation: loading3 0.6s infinite;
}

@keyframes loading1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes loading3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes loading2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}