/* General Layout */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #1A1A1A;
    color: #fff;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

/* Header Styles */
header {
    background-color: #333;
    padding: 20px;
    text-align: center;
}

header .brand-title {
    font-size: 36px;
    color: #fff;
    margin: 0;
}

header .btn {
    background-color: #007bff;
    padding: 12px 20px;
    color: #fff;
    border-radius: 4px;
    margin-top: 10px;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

header .btn:hover {
    background-color: #0056b3;
}

header .btn-secondary {
    background-color: #dc3545;
}

header .btn-secondary:hover {
    background-color: #c82333;
}

/* Slideshow Styles */
.slideshow-container {
    position: relative;
    max-width: 100%;
    height: 500px; /* Set height for slideshow */
    margin: auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.mySlides {
    display: none;
    width: 100%;
    height: 100%;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area */
    object-position: center center; /* Centers the image within the container */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.slide-image:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* Gallery Layout */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 images per row */
    gap: 15px;
    margin: 20px;
}

.image-item {
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Form Elements */
.upload-container, .login-container {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

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

label {
    display: block;
    font-size: 14px;
    color: #555;
}

input[type="text"], input[type="password"], input[type="file"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Button Styling */
button, .btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: #007bff;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s;
}

button:hover, .btn:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr); /* 2 images per row on smaller screens */
    }

    .slideshow-container {
        height: 300px; /* Smaller height for the slideshow on mobile */
    }

    .slide-image {
        object-fit: contain; /* Ensures the image is contained properly on smaller screens */
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr; /* 1 image per row on mobile */
    }

    .slideshow-container {
        height: 250px; /* Even smaller height for the slideshow on very small screens */
    }

    .slide-image {
        object-fit: contain; /* Ensures the image is contained properly on small screens */
    }
}

/* Flash Messages */
.flash-message {
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 5px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Form Improvements */
.upload-container h2, .login-container h2 {
    color: #333;
    margin-bottom: 10px;
}

.upload-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.file-label:hover {
    background-color: #5a6268;
}

.file-name {
    display: inline-block;
    color: #666;
    font-style: italic;
}

.upload-form {
    margin-top: 20px;
}

/* Loading Spinner for Upload */
.uploading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive Image Gallery - Better Breakpoints */
@media (max-width: 1200px) {
    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    header .brand-title {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    .slideshow-container {
        height: 250px;
    }
    
    header .brand-title {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    header .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Accessibility Improvements */
.btn:focus, input:focus, button:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* Loading State */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #f39c12;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
