/* ===================================
   Image Upload & Photo Gallery Styles
   =================================== */

/* Common Container Styles */
.image-upload-container,
.photo-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.upload-wrapper,
.gallery-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
}

.upload-wrapper h1,
.gallery-wrapper h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 15px;
}

/* ===================================
   Upload Form Styles
   =================================== */

.upload-message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 25px;
    font-weight: 500;
}

.upload-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.upload-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.upload-form-section {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #0073aa;
    border-radius: 5px;
    background-color: #f7f9fc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper input[type="file"]:hover {
    background-color: #e8f4f8;
    border-color: #005177;
}

.form-help {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
}

/* Preview Container */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background: #f9f9f9;
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.preview-info {
    font-size: 12px;
    color: #666;
    word-break: break-word;
}

.preview-info strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.preview-error {
    text-align: center;
    padding: 20px 10px;
}

.error-text {
    color: #d63638;
    font-weight: 600;
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn-upload {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-upload:hover:not(:disabled) {
    background-color: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.btn-upload:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-block;
}

/* Upload Info */
.upload-info {
    background-color: #f7f9fc;
    border-left: 4px solid #0073aa;
    padding: 20px;
    border-radius: 5px;
}

.upload-info h3 {
    margin-top: 0;
    color: #0073aa;
    font-size: 18px;
}

.upload-info ol {
    margin: 10px 0;
    padding-left: 20px;
}

.upload-info li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ===================================
   Photo Gallery Styles
   =================================== */

.gallery-info {
    text-align: center;
    margin-bottom: 25px;
    color: #666;
    font-size: 14px;
}

/* Photo Grid - 4 photos per row */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.photo-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.photo-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-thumbnail img {
    transform: scale(1.1);
}

.photo-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.photo-date {
    flex: 1;
}

.photo-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #0073aa;
    color: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}

.photo-download:hover {
    background-color: #005177;
    transform: scale(1.1);
}

.photo-download svg {
    width: 18px;
    height: 18px;
}

/* No Images Message */
.no-images {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-images p {
    font-size: 18px;
    margin-bottom: 20px;
}

.btn-upload-link {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-upload-link:hover {
    background-color: #005177;
}

/* ===================================
   Pagination Styles
   =================================== */

.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-btn {
    background-color: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.pagination-btn:hover {
    background-color: #005177;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-number {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.pagination-number:hover {
    background-color: #0073aa;
    color: #fff;
}

.pagination-number.active {
    background-color: #0073aa;
    color: #fff;
    font-weight: 600;
}

.pagination-dots {
    padding: 0 5px;
    color: #666;
}

/* ===================================
   Lightbox Styles
   =================================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 5px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #0073aa;
}

.lightbox-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.3);
    color: #fff;
    border: none;
    font-size: 40px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 5px;
}

.lightbox-nav button:hover {
    background-color: rgba(255,255,255,0.6);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablets */
@media (max-width: 992px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .upload-wrapper,
    .gallery-wrapper {
        padding: 30px 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .photo-thumbnail {
        height: 150px;
    }
    
    .upload-wrapper h1,
    .gallery-wrapper h1 {
        font-size: 24px;
    }
    
    .preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .btn-upload {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-nav button {
        font-size: 30px;
        padding: 5px 15px;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
    
    .image-upload-container,
    .photo-gallery-container {
        padding: 20px 10px;
    }
    
    .upload-wrapper,
    .gallery-wrapper {
        padding: 20px 15px;
    }
}
