/* Ellabm Gallery - Fullscreen Slideshow */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: none;
    transition: background 0.6s ease;
}

body.polaroid-mode {
    background: #FFF8DC;
}

/* --- Layout: sidebar + slideshow --- */
#gallery-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* --- Info sidebar --- */
#info-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100%;
    background: linear-gradient(180deg, #FFD700 0%, #FFECB3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#sidebar-content {
    text-align: center;
    padding: 40px 24px;
    color: #4a3f2f;
}

#sidebar-emoji {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

#sidebar-content h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    font-weight: 700;
    color: #3a2e1a;
}

#sidebar-content p {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #5a4e2e;
}

#sidebar-url {
    font-size: 1.6rem;
    font-weight: 700;
    color: #3a2e1a;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px 0 20px 0;
}

#sidebar-code {
    font-size: 2.8rem;
    font-weight: 800;
    color: #3a2e1a;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 14px 24px;
    margin-top: 8px;
    letter-spacing: 0.15em;
}

/* --- Slideshow area --- */
#slideshow {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#slide-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

#photo-info {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s;
}

#photo-info.visible {
    opacity: 1;
}

#photo-name {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 30px;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

#no-photos {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

#no-photos h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

#no-photos p {
    font-size: 1.5rem;
    opacity: 0.7;
}

#no-photos.hidden {
    display: none;
}

body.polaroid-mode #no-photos {
    color: #4a3f2e;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* --- Mode toggle button --- */
#mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s, background 0.3s;
}

#mode-toggle:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.3);
}

body.polaroid-mode #mode-toggle {
    background: rgba(0, 0, 0, 0.1);
    color: #5a4e2e;
}

body.polaroid-mode #mode-toggle:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* --- Polaroid mode --- */
body.polaroid-mode .slide {
    display: none;
}

#polaroid-frame {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1.5s ease-in-out;
}

#polaroid-frame.hidden {
    display: none;
}

#polaroid-frame.fading {
    opacity: 0;
}

#polaroid-inner {
    background: #fff;
    padding: 16px 16px 52px 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    transform: rotate(-1.5deg);
    transition: transform 0.6s ease;
}

#polaroid-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 130px);
    object-fit: contain;
}

#polaroid-caption {
    text-align: center;
    font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
    font-size: 1.3rem;
    color: #4a3f2f;
    margin-top: 10px;
    min-height: 1.5em;
}

/* Alternate slight rotations for variety */
#polaroid-inner.tilt-right {
    transform: rotate(1.5deg);
}

#polaroid-inner.tilt-left {
    transform: rotate(-2deg);
}

#polaroid-inner.tilt-none {
    transform: rotate(0.5deg);
}

/* Photo info styling in polaroid mode */
body.polaroid-mode #photo-info {
    display: none;
}
