:root {
    --primary-color: #f5cd79;
    --primary-hover: #e1b12c;
    --bg-color: #FFF9D6;
    --text-color: #2d3436;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.8);
    --error-color: #d63031;
    --success-color: #00b894;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200vw;
    background: radial-gradient(circle at 50% 50%, rgba(108, 92, 231, 0.15) 0%, #FFF9D6 50%);
    z-index: -1;
    animation: pulse 15s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.15), 1px 1px 1px rgba(0, 0, 0, 0.05);
}

header p {
    color: #636e72;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.upload-section {
    max-width: 500px;
    margin: 0 auto 4rem auto;
    animation: fadeInUp 1s ease-out;
}

.upload-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
}

input[type="file"] {
    display: none;
}

.file-label {
    display: block;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    background: rgba(108, 92, 231, 0.1);
}

input[type="password"] {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s ease;
}

input[type="password"]:focus {
    border-color: var(--primary-color);
}

button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(108, 92, 231, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#message {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
}

.success { color: var(--success-color); }
.error { color: var(--error-color); }

.gallery-section h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 400;
    color: #a4b0be;
}

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

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

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

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@media (max-width: 768px) {
    header h1 { font-size: 2.8rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

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

/* Modal Content (image) */
.modal-content {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

/* Close Button */
.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f2f6;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover,
.close-modal:focus {
    color: #ff7675;
}

@keyframes zoomIn {
    from {transform:scale(0.8); opacity:0}
    to {transform:scale(1); opacity:1}
}

/* Three dots menu container */
.menu-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.menu-btn {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: rgba(0,0,0,0.8);
}

.menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    min-width: 100px;
}

.menu-dropdown.show {
    display: block;
}

.menu-item-delete {
    padding: 8px 16px;
    color: #d63031;
    font-size: 0.9rem;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
}

.menu-item-delete:hover {
    background: #ffeaa7;
}

.gallery-item {
    cursor: pointer;
}
