/* Gallery Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #bfbfbf;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-header {
    position: relative;
    padding: 20px 0;
    text-align: center;
    border-bottom: 2px solid #ddd;
    margin-bottom: 30px;
}

.gallery-title {
    font-family: 'Dancing Script', cursive;
    font-size: 1em;
    color: #ddd;
    text-shadow: 
        3px 3px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    margin: 0;
}

.search-box {
    max-width: 400px;
    margin: 20px auto;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #3498db;
}

.gallery-stats {
    text-align: center;
    margin: 15px 0;
    font-size: 16px;
    color: #0a0000;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    background: white;
    border-radius: 5px;
    border: 5px solid #ffffff;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    border: 1px solid #808080;
    border-radius: 5px;
    text-decoration: none;
    color: #fffcfb;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #808080;
    color: white;
    border-color: #f000000;
}

.pagination .current {
    background: #A9A9A9;
    color: white;
    border-color: #000000;
}

.error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    margin: 20px 0;
}

.no-images {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 18px;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
}

.lightbox-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s;
}

.lightbox img:hover {
    transform: scale(1.01);
}

.lightbox-nav-btn {
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 20px;
}

.lightbox-nav-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.lightbox-nav-btn:active {
    transform: scale(0.95);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0,0,0,0.7);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(0,0,0,0.9);
}

/* Download button styling */
.download-btn {
    position: absolute;
    top: 20px;
    right: 80px;
    background: #808080;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
}

.download-btn:hover {
    background: #ff4000;
}

/* Optional: Add a simple download icon */
.download-btn::before {
    content: "↓";
    margin-right: 5px;
    font-size: 1.2em;
}

.nav-btn-left {
    order: 1;
}

.image-wrapper {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.nav-btn-right {
    order: 3;
}

/* Open in new window message - TOP LEFT */
.open-new-window-message {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1001;
    border-left: 3px solid #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.open-new-window-message::before {
    content: "💡 ";
    margin-right: 5px;
}

/* Animation for lightbox navigation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox img {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive styles */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .lightbox-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin: 0 10px;
        position: absolute;
        z-index: 1001;
    }
    
    .nav-btn-left {
        left: 10px;
    }
    
    .nav-btn-right {
        right: 10px;
    }
    
    .lightbox-container {
        flex-direction: column;
    }
    
    .image-wrapper {
        width: 100%;
    }
    
    .gallery-title {
        font-size: 2.5em;
    }
    
    .open-new-window-message {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
        max-width: 200px;
    }
    
    .download-btn {
        top: 10px;
        right: 60px;
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Hide navigation buttons when not needed on mobile */
@media (max-width: 480px) {
    .lightbox-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 10px;
        right: 10px;
    }
    
    .download-btn {
        top: 10px;
        right: 60px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .open-new-window-message {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 180px;
    }
}