:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --accent-green: #a2d2ff; /* Soft blue-green */
    --aloe-green: #74c69d;
    --deep-green: #2d6a4f;
    --text-light: #f8fbf9;
    --text-dark: #1b4332;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-dark);

    /* Background with blurred nature image */
    background:
        linear-gradient(135deg, rgba(45, 106, 79, 0.4), rgba(116, 198, 157, 0.4)),
        url('https://images.unsplash.com/photo-1509423350716-955f59776c7a?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    backdrop-filter: blur(8px); /* Blurs the background image */
}

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

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }
}

header {
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header h1 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(255,255,255,0.3);
}

/* Glassmorphism Card */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.upload-section .card {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-dark);
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--aloe-green);
    box-shadow: 0 0 15px rgba(116, 198, 157, 0.4);
}

button {
    background: linear-gradient(135deg, var(--aloe-green), var(--deep-green));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(116, 198, 157, 0.5);
    filter: brightness(1.1);
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day {
        font-size: 0.75rem;
    }
    .calendar-day-label {
        font-size: 0.7rem;
    }
    .card {
        padding: 1rem;
    }
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-dark);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.calendar-grid.updating {
    opacity: 0;
    transform: scale(0.98);
}

.calendar-day-label {
    font-weight: bold;
    font-size: 0.85rem;
    padding-bottom: 10px;
    color: var(--aloe-green);
}

.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInDay 0.4s ease forwards;
    opacity: 0;
}

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

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--glass-border);
    transform: scale(1.1);
    z-index: 1;
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.calendar-day.has-photo {
    background: linear-gradient(135deg, var(--aloe-green), var(--deep-green));
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(116, 198, 157, 0.5);
}

.calendar-day.has-photo:hover {
    box-shadow: 0 0 20px rgba(116, 198, 157, 0.8);
    filter: brightness(1.2);
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.gallery-item:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--aloe-green);
}

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

.gallery-item .filename {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    color: white;
    font-size: 0.85rem;
    padding: 12px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

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

.viewer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 90%;
    max-width: 1100px;
    z-index: 10;
}

.main-image-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content {
    max-width: 70%;
    max-height: 70vh;
    border-radius: 24px;
    border: 5px solid var(--glass-border);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    object-fit: contain;
}

.nav-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}

.nav-btn:hover {
    background: var(--aloe-green);
    transform: scale(1.1);
}

.viewer-controls {
    margin: 2rem 0;
    z-index: 10;
}

.danger-btn {
    background: rgba(231, 76, 60, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: rgba(231, 76, 60, 0.7);
}

.thumbnail-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem;
    max-width: 80%;
    justify-content: center;
    z-index: 10;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.thumb.active {
    opacity: 1;
    border-color: var(--aloe-green);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--aloe-green);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 45px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 100;
}

.close-modal:hover {
    color: var(--aloe-green);
}

#modal-caption {
    color: white;
    margin-top: 1.5rem;
    font-size: 1.4rem;
    font-weight: 300;
    letter-spacing: 1px;
}

#status-msg {
    margin-top: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
}

@media (max-width: 600px) {
    .modal-content {
        max-width: 95%;
        max-height: 70%;
    }
    .viewer-container {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    #prev-img { left: 10px; }
    #next-img { right: 10px; }
}
