:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --background-color: #2c3e50;
    --text-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: var(--text-color);
}

.container {
    max-width: 100%;
    min-height: 100vh;
    padding: 20px;
    padding-top: 80px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .container {
        padding-top: 200px;
    }
}

.palm-trees-container {
    position: fixed;
    top: -80px; /* Move the container up */
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

@media (max-width: 768px) {
    .palm-trees-container {
        top: -700px; /* Less offset on mobile */
    }
}

.palm-tree {
    width: 100%;
    height: 100%;
    opacity: 0.8;
    object-fit: cover;
    object-position: center center;
}

@media (max-width: 768px) {
    .palm-tree {
        width: 100%;
        height:130%;
        margin-left: 0;
        object-fit: contain;
        object-position: center center;
        transform: scaleY(1.7); /* Stretch vertically by 15% */
        transform-origin: center center; /* Stretch from the center */
    }
}

.upload-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px var(--shadow-color);
    z-index: 2;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 200px; /* Add space above the input box */
}

@media (max-width: 768px) {
    .upload-container {
        margin-top: 50px; /* Less space on mobile */
    }
}

.title {
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-color);
    text-shadow: 2px 2px 4px var(--shadow-color);
}

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

.password-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    font-size: 1em;
    box-sizing: border-box;
}

.password-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.upload-form {
    display: none;
}

.upload-form.visible {
    display: block;
}

.file-input-container {
    position: relative;
    margin: 20px 0;
}

.file-input {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.file-input-label:hover {
    transform: translateY(-2px);
    background: var(--secondary-color);
}

.selected-files {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    max-height: 150px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Chrome-style frosted glass */
@supports not (-webkit-hyphens:none) {
    .selected-files {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(12px);
    }
}

/* Safari-specific style */
@supports (-webkit-hyphens:none) {
    .selected-files {
        background: rgba(255, 255, 255, 0.4);
        -webkit-backdrop-filter: blur(20px);
    }
}

.upload-progress {
    width: 100%;
    height: 8px;
    background: rgba(237, 231, 231, 0.2);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 0.2s ease;
    position: relative;
    border-radius: 4px;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.submit-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.submit-button:hover {
    transform: translateY(-2px);
    background: var(--primary-color);
}

.error-message {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    padding: 10px;
    border-radius: 10px;
    margin: 10px 0;
    display: none;
}

.success-message {
    color: #7bed9f;
    background: rgba(123, 237, 159, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
    animation: success-pop 0.3s ease-out;
    transform-origin: center;
}

.success-message.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.success-message i {
    font-size: 1.2em;
    animation: success-bounce 1s ease-in-out;
}

@keyframes success-pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes success-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.recent-uploads {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Chrome-style frosted glass */
@supports not (-webkit-hyphens:none) {
    .recent-uploads {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(12px);
    }
}

/* Safari-specific style */
@supports (-webkit-hyphens:none) {
    .recent-uploads {
        background: linear-gradient(145deg, rgba(201, 151, 151, 0.8), rgba(112, 197, 191, 0.8));
        -webkit-backdrop-filter: blur(20px);
    }
}

/* Ensure text is visible on Safari */
.recent-uploads h3 {
    color: rgb(255, 255, 255);
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Add shadow for better contrast */
}

/* .recent-uploads h3 {
    color: white;
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
} */

.recent-photos-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
}

.recent-photos-scroll::-webkit-scrollbar {
    height: 8px;
}

.recent-photos-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.recent-photos-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #4ecdc4 0%, #ff6b6b 100%);
    border-radius: 4px;
}

/* Firefox */
.recent-photos-scroll {
    scrollbar-width: thin;
    scrollbar-color: #4ecdc4 rgba(255, 255, 255, 0.1);
}

.recent-photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    flex: 0 0 150px;
    height: 150px;
    transition: transform 0.3s ease;
}

.recent-photo-item:hover {
    transform: scale(1.05);
}

.recent-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.photo-info .uploader {
    display: block;
    font-size: 0.7em;
    opacity: 0.7;
}

.photo-info .upload-date {
    display: block;
    font-size: 0.7em;
    opacity: 0.7;
}

/* Preview container styles */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    backdrop-filter: blur(5px);
    width: 100%;
    box-sizing: border-box;
}

.preview-container:empty {
    display: none;
}

.preview-container::-webkit-scrollbar {
    width: 6px;
}

.preview-container::-webkit-scrollbar-track {
    background: transparent;
}

.preview-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.preview-item {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    transition: transform 0.2s;
    position: relative;
}

.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 0, 0, 0.1); /* Debug background */
}

.preview-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preview-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* border: 2px solid blue; Debug border */
    display: block;
}

.preview-item:hover {
    transform: scale(1.05);
}

.preview-loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.5em;
}

.preview-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

.preview-item:hover .remove-photo {
    opacity: 1;
}

.preview-container::-webkit-scrollbar {
    width: 6px;
}

.preview-container::-webkit-scrollbar-track {
    background: transparent;
}

.preview-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}



.preview-loading,
.preview-placeholder,
.preview-error {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    text-align: center;
    box-sizing: border-box;
}

.preview-placeholder i,
.preview-error i {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.preview-placeholder .file-info,
.preview-error div {
    font-size: 10px;
    opacity: 0.8;
    word-break: break-word;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    transition: background-color 0.2s;
    z-index: 2;
}

.remove-photo:hover {
    background: rgba(255, 0, 0, 0.9);
}

.photo-counter {
    margin: 16px 0;
    color: var(--text-color);
    font-size: 0.9em;
    opacity: 0.8;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: 20px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2em;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.1);
}

.modal-info {
    color: white;
    margin-top: 15px;
    text-align: center;
    font-size: 1.1em;
}

.modal-uploader {
    margin-bottom: 8px;
}

.modal-date {
    opacity: 0.8;
    font-size: 0.9em;
}

/* Make photos clickable */
.recent-photo-item {
    cursor: pointer;
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .upload-container {
        width: 95%;
        padding: 20px;
    }
    
    .title {
        font-size: 1.5em;
    }
    
    .preview-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}



/* Gallery link styles */
.gallery-link-container {
    display: none;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.gallery-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0 5px 10px 5px;
}

.gallery-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
    background: #3dbeb5;
}

.download-link {
    background: var(--primary-color);
}

.download-link:hover {
    background: var(--secondary-color);
}

.download-info {
    display: none;
    font-size: 0.85em;
    color: white;
    text-align: center;
    margin: 10px auto;
    max-width: 80%;
    line-height: 1.5;
}

.download-info.visible {
    display: block;
}

/* Zip metadata styles */
.zip-metadata {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
}

.metadata-item {
    margin: 5px 10px;
    font-size: 0.9em;
    color: white;
    display: flex;
    align-items: center;
}

.metadata-item i {
    margin-right: 5px;
    color: var(--secondary-color);
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted white;
    cursor: help;
    color: var(--secondary-color);
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.gallery-link i {
    margin-right: 10px;
}
