/* Reset and General styles for mobile first responsiveness */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #0f172a; /* Slate 900 */
    color: #f8fafc; /* Slate 50 */
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h1 {
    font-size: 1.1rem;
    text-align: center;
    margin: 5px 0;
    font-weight: 600;
    color: #94a3b8;
}

/* Slideshow Container */
.slideshow-display {
    background: #1e293b;
    border-radius: 8px;
    padding: 10px;
}

#slideshow {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5; 
    max-height: 75vh;
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#slideshow:fullscreen {
    background-color: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; 
    animation-name: kenburns;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes kenburns {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.1) translate(-1%, -1%); }
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.controls button {
    background: #334155;
    color: #f8fafc;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.controls button:hover { background: #475569; }
#play-pause-btn { background: #3b82f6; }
#play-pause-btn:hover { background: #2563eb; }
#clear-btn { background: #ef4444; }

.rate-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #334155;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.rate-control input {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 3px;
    width: 50px;
    padding: 2px 4px;
    text-align: center;
}

/* Upload Drop Zone */
.upload-section {
    background: #1e293b;
    border-radius: 8px;
    padding: 10px;
}

.upload-section h3 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #cbd5e1;
    text-align: center;
}

.drop-zone {
    position: relative;
    border: 2px dashed #475569;
    border-radius: 6px;
    padding: 20px 10px;
    text-align: center;
    background: #0f172a;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* IMPORTANT: Ensure children don't intercept drag events */
.drop-zone > * {
    pointer-events: none;
}

/* Buttons inside drop zone need pointer events back */
.drop-zone .button-group, .drop-zone button {
    pointer-events: auto;
}

.drop-zone.highlight {
    border-color: #3b82f6;
    background: #1e293b;
}

.drop-zone p { margin: 2px 0; color: #64748b; font-size: 0.75rem; }

.button-group { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

.drop-zone button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}

#upload-status { margin-top: 8px; text-align: center; font-size: 0.75rem; min-height: 1.2em; }
