/* Photo Gallery Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.category-filter {
    margin: 20px 0;
    text-align: center;
}

.category-filter label {
    color: white;
    margin-right: 10px;
    font-weight: 500;
}

.category-filter select {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-filter select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Photo Grid Styles */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.photo-item {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 20px 15px 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-description {
    font-size: 0.8rem;
    opacity: 0.9;
    display: block;
    margin-top: 5px;
    line-height: 1.3;
}

.photo-category {
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
    margin-top: 3px;
    font-style: italic;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-name {
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* No Images Message */
.no-images {
    grid-column: 1 / -1;
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.no-images p {
    margin-bottom: 10px;
    color: #666;
}

.no-images code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Single Image View Styles */
.single-view {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.back-button {
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-back {
    background: #667eea;
    color: white;
}

.btn-back:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-refresh {
    background: #28a745;
    color: white;
    margin-top: 10px;
}

.btn-refresh:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-admin {
    background: #6f42c1;
    color: white;
    margin-top: 10px;
    margin-left: 10px;
}

.btn-admin:hover {
    background: #5a32a3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(111, 66, 193, 0.4);
}

.image-container {
    text-align: center;
}

.full-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.image-info h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.image-info p {
    color: #666;
    font-size: 1rem;
}

.image-description {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.5;
}

.image-category {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 10px;
}

.image-details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #495057;
    border-left: 4px solid #667eea;
}

.error-message {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.error-message h2 {
    color: #dc3545;
    margin-bottom: 15px;
}

.error-message p {
    color: #666;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .single-view {
        padding: 20px;
    }
    
    .full-image {
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}

/* Loading Animation */
.photo-item img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item img[loading="lazy"].loaded {
    opacity: 1;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Image Protection Styles */
.image-protection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10;
    pointer-events: none;
}

/* Protection Message Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Ensure images can't be selected or dragged */
img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* Allow photo items to be clickable while protecting images */
.photo-item {
    position: relative;
}

.photo-item img {
    pointer-events: none;
}

.photo-item:hover {
    cursor: pointer;
}

/* Copyright Notice */
.copyright-notice {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.copyright-notice p {
    margin: 5px 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.copyright-notice small {
    opacity: 0.7;
    font-size: 0.8rem;
}
