body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #f9f5f0;
    color: #333;
}

#sidebar {
    width: 220px;
    background: #fff8f0;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

#sidebar div {
    cursor: pointer;
    padding: 10px 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    user-select: none;
    font-weight: 600;
    color: #5a3e2b;
    transition: background-color 0.2s;
}

#sidebar div:hover {
    background: #f0d8b8;
}

#gallery-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

h2 {
    margin-top: 0;
    color: #7a5230;
    font-weight: 700;
    text-transform: capitalize;
    border-bottom: 2px solid #d9b08c;
    padding-bottom: 6px;
    margin-bottom: 16px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.photo-grid img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    object-fit: cover;
    height: 140px;
}

.photo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px rgba(0,0,0,0.25);
}

#fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 20, 10, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

#fullscreen img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.7);
    margin-bottom: 12px;
    user-select: none;
    -webkit-user-drag: none;
}

#photo-name {
    color: #f2d8b8;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
    text-shadow: 1px 1px 3px #442a0d;
}

#photo-date {
    color: #d1b28f;
    font-size: 1rem;
    margin-bottom: 15px;
    font-style: italic;
    text-shadow: 1px 1px 3px #5a3e2b;
    user-select: text;
    font-family: 'Georgia', serif;
    letter-spacing: 0.05em;
    text-align: center;
}

#download-btn {
    background: #7a5230;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: underline;
    font-weight: 400;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    user-select: none;
    transition: background-color 0.3s ease;
    font-family: "Google Sans Code", 'Georgia', serif;
    position: absolute;
    bottom: 10px;
    right: 10px;
    margin: 0;
}

#download-btn:hover {
    background: #a47042;
}

#fullscreen-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: #f2d8b8;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
    text-shadow: 1px 1px 4px #442a0d;
}

#sidebar::-webkit-scrollbar,
#gallery-container::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-thumb,
#gallery-container::-webkit-scrollbar-thumb {
    background-color: #d9b08c;
    border-radius: 4px;
}

@media (orientation: landscape) and (max-width: 900px) {
    #sidebar {
        width: 100px;
        padding: 12px 10px;
    }
}

@media (orientation: landscape) {
    #fullscreen {
        align-items: center;
    }

    #fullscreen img {
        max-width: 70vw;
        max-height: 70vh;
        margin-bottom: 0;
        position: relative;
    }
}

#sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10000;
    background: #7a5230;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 1.4rem;
    cursor: pointer;
    user-select: none;
}

@media (max-width: 600px) {
    #sidebar-toggle {
        display: block;
    }

    #sidebar {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: #fff8f0;
        z-index: 10001;
        width: 100%;
        height: 100%;
        padding: 40px 20px 20px 20px;
        overflow-y: auto;
        border-right: none;
        box-sizing: border-box;
        flex-direction: column;
    }
}

#sidebar.open {
    display: flex !important;
}

#sidebar-close {
    position: absolute;
    top: 12px;
    right: 20px;
    font-size: 2rem;
    font-weight: 700;
    color: #7a5230;
    cursor: pointer;
    user-select: none;
}
