/* Reset dan Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #a7fcff, #fab1a0);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 20px 20px;
}

h1 {
    font-size: 2.5rem;
    color: #d63031;
}

h2 {
    margin-bottom: 1rem;
    color: #e17055;
}

/* Upload Section */
#upload-section {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#drop-zone {
    border: 2px dashed #ddd;
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#drop-zone:hover, #drop-zone.dragover {
    border-color: #e17055;
    background: rgba(255, 193, 193, 0.2);
}

#file-input-label {
    color: #0984e3;
    text-decoration: underline;
}

form {
    margin-top: 1rem;
}

input, textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    border-color: #e17055;
    outline: none;
}

button {
    background: linear-gradient(135deg, #1b1b1b, #e84393);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#preview {
    text-align: center;
    margin-top: 1rem;
}

#preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #e17055;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-spinner p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #e17055;
}

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

/* Undo Notification */
.undo-notification {
    display: none;
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.undo-notification p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

#undo-btn {
    background: #0984e3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 1rem;
    transition: background 0.3s;
}

#undo-btn:hover {
    background: #74b9ff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Gallery */
#gallery-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.memory-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.memory-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.memory-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.memory-item .info {
    padding: 1rem;
}

.memory-item h3 {
    font-size: 1.2rem;
    color: #d63031;
}

.memory-item p {
    font-size: 0.9rem;
    color: #636e72;
}

.memory-item .date {
    font-size: 0.8rem;
    color: #a29bfe;
    margin-top: 0.5rem;
}

.delete-btn {
    background: #e17055;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #d63031;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 80%;
    max-height: 80%;
    text-align: center;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
}

#modal-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
}

#modal-date {
    font-size: 0.9rem;
    color: #a29bfe;
    margin-top: 1rem;
}

/* Responsif */
@media (max-width: 768px) {
    #gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    h1 {
        font-size: 2rem;
    }
}
/* Reset dan Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px; /* Base font size */
}

header {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 20px 20px;
}

h1 {
    font-size: 2.5rem;
    color: #d63031;
}

h2 {
    margin-bottom: 1rem;
    color: #e17055;
}

/* Upload Section */
#upload-section {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#drop-zone {
    border: 2px dashed #ddd;
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#drop-zone:hover, #drop-zone.dragover {
    border-color: #e17055;
    background: rgba(255, 193, 193, 0.2);
}

#file-input-label {
    color: #0984e3;
    text-decoration: underline;
}

form {
    margin-top: 1rem;
}

input, textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    border-color: #e17055;
    outline: none;
}

button {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#preview {
    text-align: center;
    margin-top: 1rem;
}

#preview-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #e17055;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-spinner p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #e17055;
}

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

/* Undo Notification */
.undo-notification {
    display: none;
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.undo-notification p {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

#undo-btn {
    background: #0984e3;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 1rem;
    transition: background 0.3s;
}

#undo-btn:hover {
    background: #74b9ff;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Gallery */
#gallery-section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.memory-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.memory-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.memory-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.memory-item .info {
    padding: 1rem;
}

.memory-item h3 {
    font-size: 1.2rem;
    color: #d63031;
}

.memory-item p {
    font-size: 0.9rem;
    color: #636e72;
}

.memory-item .date {
    font-size: 0.8rem;
    color: #a29bfe;
    margin-top: 0.5rem;
}

.delete-btn {
    background: #e17055;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #d63031;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 80%;
    max-height: 80%;
    text-align: center;
    position: relative;
    overflow-y: auto; /* Scroll jika konten panjang */
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
}

#modal-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
}

#modal-date {
    font-size: 0.9rem;
    color: #a29bfe;
    margin-top: 1rem;
}

/* Responsif: Tablet (480px - 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* Font lebih kecil */
    }
    header {
        padding: 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    #upload-section {
        margin: 1rem auto;
        padding: 1.5rem;
    }
    #drop-zone {
        padding: 1.5rem;
    }
    #gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 2-3 kolom */
        gap: 0.8rem;
    }
    .memory-item img {
        height: 180px;
    }
    .memory-item .info {
        padding: 0.8rem;
    }
    .modal-content {
        max-width: 90%;
        max-height: 90%;
        padding: 1.5rem;
    }
    #modal-img {
        max-height: 300px;
    }
}

/* Responsif: HP Kecil (< 480px) */
@media (max-width: 480px) {
    body {
        font-size: 12px; /* Font lebih kecil lagi */
    }
    header {
        padding: 1rem;
    }
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    #upload-section {
        margin: 1rem 0.5rem;
        padding: 1rem;
        max-width: 100%;
    }
    #drop-zone {
        padding: 1rem;
    }
    input, textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    #gallery {
        grid-template-columns: 1fr; /* 1 kolom */
        gap: 0.5rem;
        margin: 1rem 0.5rem;
        padding: 1rem;
    }
    .memory-item img {
        height: 150px;
    }
    .memory-item .info {
        padding: 0.6rem;
    }
    .memory-item h3 {
        font-size: 1rem;
    }
    .memory-item p {
        font-size: 0.8rem;
    }
    .memory-item .date {
        font-size: 0.7rem;
    }
    .delete-btn {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    .modal-content {
        max-width: 95%;
        max-height: 95%;
        padding: 1rem;
    }
    #modal-img {
        max-height: 250px;
    }
    .undo-notification {
        top: 80px;
        padding: 0.8rem 1.5rem;
    }
    .undo-notification p {
        font-size: 0.9rem;
    }
    #undo-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}