/* Start coding the style.css file */

/* Apply basic styles: box-sizing border-box to all elements, basic font (sans-serif), remove default body margin */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==== MODERN HEADER STYLES ==== */
.site-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: relative; /* Changed from 'sticky' to 'relative' */
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.site-header:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo-wrapper {
    flex: 0 0 auto;
    z-index: 10;
}

.logo {
    max-height: 60px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.banner-container {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.celebration-banner {
    max-height: 70px;
    max-width: 50%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.4s ease;
}

.header-container:hover .celebration-banner {
    transform: translateY(-2px) scale(1.02);
}

.button-wrapper {
    flex: 0 0 auto;
    z-index: 10;
}

.back-button {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #4f8cb4 0%, #3a6a89 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 140, 180, 0.3);
}

.back-button i {
    margin-right: 6px;
}

.back-button:hover {
    background: linear-gradient(135deg, #3a6a89 0%, #4f8cb4 100%);
    box-shadow: 0 4px 12px rgba(79, 140, 180, 0.5);
    transform: translateY(-2px);
}

.back-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(79, 140, 180, 0.3);
}

/* ==== MODERN FOOTER STYLES ==== */
.site-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem 0 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.footer-logo {
    margin-right: 1.5rem;
}

.footer-logo-img {
    max-height: 50px;
    filter: grayscale(20%) opacity(80%);
    transition: all 0.3s ease;
}

.footer-logo-img:hover {
    filter: grayscale(0%) opacity(100%);
}

.footer-text {
    color: #666;
    font-size: 0.9rem;
}

.footer-text p {
    margin: 0.3rem 0;
}

.footer-credits {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

.footer-credits a {
    color: #4f8cb4;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-credits a:hover {
    color: #3a6a89;
}

.footer-credits a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #3a6a89;
    transition: width 0.3s ease;
}

.footer-credits a:hover::after {
    width: 100%;
}

.footer-credits .fa-heart {
    color: #e74c3c;
    font-size: 0.8rem;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Style the main element: Set max-width, center it using margin auto, add padding, background color white, maybe a subtle box-shadow */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    flex-grow: 1;
}

/* Style the H1 heading: Center align, add margin-bottom */
h1 {
    font-family: 'Noto Serif Bengali', serif;
    text-align: center;
    margin-bottom: 2rem;
    color: #4f8cb4;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

/* Style the gallery container (#gallery): Use CSS Grid for layout */
#gallery {
    display: grid;
    /* Force grid to always have multiple columns with a minimum width of 250px */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Style individual gallery items (assuming JS creates divs with class 'gallery-item'): maybe add some padding or border */
.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Style the gallery images (img elements inside #gallery or .gallery-item): Set width 100%, height auto, display block, maybe a subtle border or box-shadow */
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 3/2;
}

/* Add a hover effect for gallery images (e.g., slight scale or opacity change) */

/* Style the button container to hold both buttons */
.button-container {
    display: flex;
    width: 100%;
}

/* Style the download button updated for the flex layout */
.download-button {
    flex: 1;
    margin-top: 0;
    padding: 0.5rem;
    background-color: #4f8cb4;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0 0 0 8px;
    transition: background-color 0.3s;
    border: none;
}

.download-button:hover {
    background-color: #3a6a89;
}

/* Style the copy URL button */
.copy-url-button {
    flex: 1;
    padding: 0.5rem;
    background-color: #5cb85c;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0 0 8px 0;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.copy-url-button:hover {
    background-color: #4cae4c;
}

.copy-url-button.copied {
    background-color: #3c763d;
}

/* ==== PAGINATION CONTROLS ==== */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem; /* Add space above the controls */
    gap: 1rem; /* Add space between buttons */
}

.pagination-controls button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4f8cb4 0%, #3a6a89 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 140, 180, 0.3);
    text-align: center;
}

.pagination-controls button:hover {
    background: linear-gradient(135deg, #3a6a89 0%, #4f8cb4 100%);
    box-shadow: 0 4px 12px rgba(79, 140, 180, 0.5);
    transform: translateY(-2px);
}

.pagination-controls button:disabled {
    background: linear-gradient(135deg, #aabbcc 0%, #99aabb 100%); /* Greyed out */
    color: #eeeeee;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ==== Page Number Display ==== */
.page-number {
    display: inline-block; /* To allow padding/margins */
    padding: 0.5rem 1rem;
    margin: 0 0.5rem; /* Space between buttons and number */
    font-size: 1rem;
    font-weight: 500;
    color: #555; /* Or choose a color that fits your theme */
    background-color: #f0f0f0; /* Light background */
    border-radius: 4px;
    min-width: 80px; /* Ensure it has some width */
    text-align: center;
}

/* Add CSS Media Queries for responsiveness */

/* Media query for tablet screens (e.g., min-width: 600px): Adjust gallery columns (e.g., minmax(200px, 1fr)), maybe increase font sizes */
@media (max-width: 599px) {
    #gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    main {
        padding: 1rem;
        margin: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}

/* Media query for tablet screens (e.g., min-width: 600px): Adjust gallery columns (e.g., minmax(200px, 1fr)), maybe increase font sizes */
@media (min-width: 600px) and (max-width: 899px) {
    #gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Media query for desktop screens (e.g., min-width: 900px): Adjust gallery columns (e.g., minmax(250px, 1fr)), adjust main max-width */
@media (min-width: 900px) and (max-width: 1199px) {
    #gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Media query for larger desktop screens */
@media (min-width: 1200px) and (max-width: 1599px) {
    #gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Media query for extra large screens */
@media (min-width: 1600px) {
    #gallery {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Responsive styles for the banner */
@media (max-width: 768px) {
    .celebration-banner {
        max-width: 40%;
        max-height: 50px;
    }
}

@media (max-width: 480px) {
    header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
    
    .banner-container {
        position: relative;
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .celebration-banner {
        max-width: 80%;
    }
}

/* RESPONSIVE STYLES */
/* Mobile Small - Extra Small Screens */
@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem;
        align-items: center;
        position: relative;
        justify-content: space-between;
    }

    .logo-wrapper {
        margin: 0;
        z-index: 1;
    }

    .button-wrapper {
        margin: 0;
        z-index: 1;
    }

    .banner-container {
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        pointer-events: auto;
    }

    .celebration-banner {
        max-width: 75%;
        max-height: 45px;
        object-fit: contain;
    }

    .logo {
        max-height: 35px;
        flex-shrink: 0;
    }

    .back-button {
        padding: 0;
        font-size: 0;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border-radius: 50%;
    }

    .back-button i {
        font-size: 1rem;
        margin-right: 0;
    }

    main {
        padding: 1rem;
        margin: 1rem;
        border-radius: 8px;
    }

    .footer-info {
        flex-direction: column;
        text-align: center;
    }

    .footer-logo {
        margin: 0 0 1rem 0;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* Mobile Medium - Small Screens */
@media (min-width: 481px) and (max-width: 767px) {
    .header-container {
        padding: 0.6rem;
    }
    
    .celebration-banner {
        max-width: 60%;
    }
    
    .logo {
        max-height: 50px;
    }
    
    .back-button {
        font-size: 0.9rem;
    }
    
    main {
        padding: 1.5rem;
        margin: 1.5rem;
    }
    
    .footer-info {
        flex-direction: column;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .footer-logo {
        margin: 0 0 1rem 0;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .celebration-banner {
        max-width: 40%;
    }
    
    main {
        margin: 1.5rem;
    }
}

/* Desktops */
@media (min-width: 992px) {
    .header-container, .footer-container {
        max-width: 1200px;
    }
    
    main {
        max-width: 1100px;
        padding: 2.5rem;
    }
}

/* Large Desktops */
@media (min-width: 1200px) {
    .header-container, .footer-container {
        max-width: 1400px;
    }
    
    main {
        max-width: 1300px;
    }
}

/* Download Notification Styles */
.download-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4f8cb4;
    color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

.download-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    width: 0;
    transition: width 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* URL Copy Notification */
.url-copy-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInOut 2s ease;
    pointer-events: none;
}

.url-copy-notification i {
    color: #4f8cb4;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Improved Cart Button Styles */
.cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4f8cb4;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(79, 140, 180, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-button i {
    font-size: 1.2rem;
}

.cart-button .cart-count {
    background: white;
    color: #4f8cb4;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 4px;
}

@media (max-width: 768px) {
    .cart-button {
        padding: 12px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        justify-content: center;
    }

    .cart-button span {
        display: none;
    }

    .cart-button .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* Cart Modal Styles */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cart-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cart-items {
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.remove-item-btn:hover {
    background-color: #ffeeee;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.cart-actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-all-btn {
    background: linear-gradient(135deg, #4f8cb4 0%, #3a6a89 100%);
    color: white;
}

.clear-cart-btn {
    background: #ff4444;
    color: white;
}

.close-cart-btn {
    background: #f0f0f0;
    color: #333;
}

.cart-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Batch Download Button Styles */
.batch-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(79, 140, 180, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    opacity: 0;
}

.gallery-item:hover .batch-download-btn {
    opacity: 1;
}

.batch-download-btn:hover {
    background: rgba(58, 106, 137, 0.9);
    transform: scale(1.1);
}

.batch-download-btn.added {
    background: #5cb85c;
    animation: pulse 0.5s ease;
}

.batch-download-btn i {
    font-size: 14px;
}

/* Add responsive styles for buttons */
@media (max-width: 768px) {
    .download-button, .copy-url-button {
        padding: 0.5rem;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .download-button::before {
        content: '\f019';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        margin-right: 0;
    }

    .copy-url-button::before {
        content: '\f0c5';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        margin-right: 0;
    }

    .download-button span, .copy-url-button span {
        display: none;
    }

    .cart-button {
        padding: 0.5rem;
        min-width: 40px;
    }

    .cart-button span {
        display: none;
    }
}

@media (min-width: 769px) {
    .download-button::before, .copy-url-button::before {
        display: none;
    }

    .download-button span, .copy-url-button span {
        display: inline;
    }

    .cart-button span {
        display: inline;
    }
}