/* --- Upload Zone Section Styles --- */
.upload-zone-section {
    padding: 120px 50px;
    background-color: rgba(0, 0, 0, 0.8); /* Slightly darker for contrast */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
    overflow: hidden; /* Important for containing horizontal scroll */
    border-top: 1px solid rgba(0, 255, 234, 0.2);
    border-bottom: 1px solid rgba(0, 255, 234, 0.2);
    box-shadow: inset 0 0 20px rgba(0, 255, 234, 0.1);
    position: relative;
    z-index: 1;
    min-height: 100vh; /* Ensure it takes full viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone-content-wrapper {
    max-width: 1200px; /* Wider for gallery */
    margin: 0 auto;
    padding: 40px;
    background-color: rgba(20, 20, 30, 0.7); /* Slightly lighter than section background */
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 234, 0.3);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Take full width of parent */
}

.upload-zone-section h2 {
    font-size: clamp(2.5rem, 4.5vw, 3.5rem);
    color: var(--primary-color);
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 234, 0.5);
}

.upload-zone-section p {
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.8;
    margin-bottom: 30px; /* More space below description */
    font-weight: 300;
    color: #e0e0e0;
}

.upload-btn {
    margin-bottom: 40px; /* Space between button and gallery */
    font-size: 1.1em;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-btn i {
    font-size: 1.3em;
}

/* --- Image Gallery Styles (Horizontal Scrolling) --- */
.gallery-container {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling */
    white-space: nowrap; /* Prevent items from wrapping */
    padding-bottom: 20px; /* Space for scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-color) rgba(255, 255, 255, 0.1); /* Firefox */
}

/* Custom scrollbar for Webkit browsers */
.gallery-container::-webkit-scrollbar {
    height: 8px;
}

.gallery-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.gallery-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}


.image-gallery {
    display: inline-flex; /* Use inline-flex to keep items in a single row */
    gap: 30px; /* Space between image cards */
    padding: 10px; /* Padding around the images within the scrollable area */
    align-items: flex-start; /* Align items to the top */
}

.image-card {
    flex: 0 0 auto; /* Prevent cards from growing or shrinking */
    width: 300px; /* Fixed width for each image card */
    background: rgba(20, 20, 30, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 255, 234, 0.2);
    border: 1px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 450px; /* Fixed height for consistent cards */
}

.image-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 255, 234, 0.4);
}

.image-card .user-info {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-card .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color); /* Placeholder background */
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark-text);
    font-size: 1.2em;
    font-weight: bold;
}

.image-card .user-avatar i {
    color: var(--dark-text);
}

.image-card .username {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95em;
}

.image-card .image-wrapper {
    width: 100%;
    height: 250px; /* Fixed height for the image itself */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a2a; /* Dark background for images */
}

.image-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if necessary */
    display: block;
}

.image-card .description {
    padding: 10px 15px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    flex-grow: 1; /* Allows description to take available space */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal; /* Allow text to wrap */
    max-height: 50px; /* Limit height for description */
}

.image-card .like-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.image-card .like-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1.2em;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 5px 10px; /* Make clickable area larger */
    border-radius: 5px;
}

.image-card .like-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.image-card .like-btn.liked {
    color: #ff4d4d; /* Red for liked state */
    transform: scale(1.1);
    text-shadow: 0 0 8px #ff4d4d;
}

.image-card .like-count {
    font-size: 0.9em;
    color: var(--text-color);
    font-weight: 500;
}

/* --- Image Upload Modal Styles --- */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* Darker overlay */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 10000; /* Above everything else */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, display 0.4s;
}

.upload-modal.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}

.upload-modal-content {
    background: rgba(20, 20, 30, 0.9); /* Dark, semi-transparent background */
    border: 1px solid var(--primary-color);
    padding: 30px 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px; /* Max width for the modal */
    position: relative;
    text-align: center;
    color: var(--text-color);
    backdrop-filter: blur(25px);
    transform: scale(0.95);
    transition: transform 0.4s ease;
    box-shadow: 0 0 50px rgba(0, 255, 234, 0.5);
}

.upload-modal.active .upload-modal-content {
    transform: scale(1);
}

.upload-modal-content h2 {
    margin-bottom: 25px;
    font-family: var(--font-primary);
    font-weight: 500;
    color: var(--primary-color);
}

.upload-modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Custom File Input Styling */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
    margin-bottom: 10px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.custom-file-upload {
    display: inline-block;
    padding: 12px 20px;
    background: var(--accent-color);
    color: var(--dark-text);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.custom-file-upload:hover {
    background: var(--primary-hover);
}

.file-name-display {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-preview-container {
    width: 100%;
    height: 200px;
    background-color: #1a1a2a;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.upload-modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    outline: none;
    background: var(--bg-blur-light);
    color: var(--text-color);
    font-family: var(--font-primary);
    resize: vertical; /* Allow vertical resizing */
    min-height: 60px;
    transition: border-color 0.3s ease;
}

.upload-modal-content textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.upload-modal-content textarea:focus {
    border-color: var(--primary-color);
}

.upload-modal-content button[type="submit"] {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--primary-color);
    color: var(--dark-text);
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-family: var(--font-primary);
}

.upload-modal-content button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.close-upload-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-color);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close-upload-modal:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* --- Mobile Responsiveness for Upload Zone --- */
@media (max-width: 768px) {
    .upload-zone-section {
        padding: 80px 15px;
    }

    .upload-zone-content-wrapper {
        padding: 20px;
    }

    .upload-zone-section h2 {
        font-size: 2rem;
    }

    .upload-zone-section p {
        font-size: 0.95rem;
    }

    .upload-btn {
        font-size: 1em;
        padding: 12px 25px;
    }

    .image-card {
        width: 250px; /* Slightly smaller cards on mobile */
        height: 400px;
    }

    .image-card .image-wrapper {
        height: 200px; /* Adjust image height */
    }

    .upload-modal-content {
        padding: 25px 30px;
    }

    .upload-modal-content h2 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .image-card {
        width: 220px; /* Even smaller for very small screens */
        height: 380px;
    }
    .image-card .image-wrapper {
        height: 180px;
    }
}
