@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    color: #333;
}

.container {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
    width: 100%;
    max-width: 1400px;
    border: 1px solid rgba(255, 255, 255, 0.18); /* Added for a subtle border */
}

#main-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-top: 25px;
}

.panel {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

h1 {
    color: #000;
    font-weight: 600;
    font-size: 2.5rem;
}

h2 {
    color: #333;
    font-weight: 600;
    margin-bottom: 20px;
}

#login-view, #register-view {
    background-color: transparent;
    padding: 0;
    border: none;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

input[type="email"],
input[type="password"],
input[type="file"] {
    width: 300px;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

button, a#show-register-link, a#show-login-link {
    background-color: #007aff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 10px;
    transition: background-color 0.2s, transform 0.2s;
    text-decoration: none;
    display: inline-block;
}

button:hover, a#show-register-link:hover, a#show-login-link:hover {
    background-color: #005ecb;
    transform: translateY(-2px);
}

#logout-button {
    background-color: #6c757d;
}

#logout-button:hover {
    background-color: #5a6268;
}

#upload-form-container {
    margin-top: 20px;
}

#upload-status {
    margin-top: 15px;
    font-weight: 500;
    color: #555;
}

#folder-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.folder-item a {
    display: block;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
    border: 1px solid #e9ecef;
}

.folder-item a:hover {
    background-color: #f1f3f5;
    transform: translateY(-2px);
}

#image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

#image-gallery img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border-radius: 12px;
}

#image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#pagination-controls {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#page-info {
    font-weight: 500;
    color: #555;
}

#back-to-folders {
    margin-bottom: 20px;
}

#carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background-color: #e9ecef;
    height: 300px;
}

#carousel-slide {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

#carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

#carousel-prev, #carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

#carousel-prev {
    left: 15px;
}

#carousel-next {
    right: 15px;
}

.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default, can be overridden by JS */
}

.modal-content {
    margin: auto;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 80vh;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

#caption {
    display: none;
}

#modal-image {
    max-width: 100%;
    max-height: 100%;
}

#share-button-modal {
    display: block;
    margin: 20px auto;
    z-index: 110;
    position: relative;
}

@media (max-width: 1200px) {
    #main-content {
        grid-template-columns: 1fr 1fr;
    }
    #community-carousel-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    #main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    #image-gallery {
        justify-content: center;
    }
}
