/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors */
    --primary-bg: #1a1a1a;
    --panel-bg: #ffffff;
    --text-primary: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --accent: #4a90e2;
    --danger: #e74c3c;
    --success: #27ae60;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    
    /* Font Size Scale (1.125 ratio) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-md: 1.125rem;     /* 18px */
    --font-size-lg: 1.266rem;     /* 20px */
    --font-size-xl: 1.424rem;     /* 23px */
    --font-size-2xl: 1.602rem;    /* 26px */
    --font-size-3xl: 1.802rem;    /* 29px */
    
    /* Special Sizes (responsive) */
    --font-size-slideshow: clamp(1.5rem, 5vw, 4rem);
    --font-size-clock: clamp(4rem, 12vw, 10rem);
    --font-size-date: clamp(1.5rem, 4vw, 3rem);
    
    /* Line Height Scale */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Font Weight Scale */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Backgrounds */
    --photo-slide-bg: #000000;
    --text-slide-bg: #2c3e50;
    
    /* Layout */
    --text-slide-width: 85%;
    --photo-corner-radius: 0.5rem;
    
    /* Spacing & Animation */
    --transition: 0.3s ease;
    --transition-duration: 1s; /* For slide transitions */
    --panel-width: 600px;
    --panel-close-scale: 0.95; /* Scale for panel close animation */
    --caption-position: relative; /* relative or fixed */
    --fade-to-black-duration: 0.5s;
    --fade-in-duration: 1s;
    
    /* Spacing Scale */
    --space-0: 0;
    --space-xs: 0.25rem;  /* 4px */
    --space-sm: 0.5rem;   /* 8px */
    --space-md: 0.75rem;  /* 12px */
    --space-lg: 1rem;     /* 16px */
    --space-xl: 1.5rem;   /* 24px */
    --space-2xl: 2rem;    /* 32px */
    
    /* Button System */
    --btn-border-radius: 0.5rem;
    --btn-border-radius-sm: 0.25rem;
    --btn-padding-xs: 0;
    --btn-padding-sm: var(--space-xs) var(--space-sm);
    --btn-padding-md: var(--space-sm) var(--space-lg);
    --btn-padding-lg: var(--space-md) var(--space-xl);
    --btn-font-size-xs: var(--font-size-xs);
    --btn-font-size-sm: var(--font-size-sm);
    --btn-font-size-md: var(--font-size-base);
    --btn-font-size-lg: var(--font-size-lg);
    
    /* Emoji Icons - Commented out except trash and settings */
    --emoji-settings: "⚙";
    /* --emoji-photo: "📷 ";
    --emoji-text: "📝 ";
    --emoji-export: "📥 ";
    --emoji-import: "📤 ";
    --emoji-delete: "🗑️ ";
    --emoji-reset: "⚠️ ";
    --emoji-formatting: "✏️ ";
    --emoji-update: "🔄 "; */
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

body {
    background: var(--primary-bg);
    position: relative;
}

.hidden {
	display: none ! important;
}

/* ============================================
   BUTTON SYSTEM
   ============================================ */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: opacity var(--transition), background var(--transition);
    white-space: nowrap;
}

/* Button Sizes */
.btn-xs {
    width: 22px;
    height: 22px;
    padding: var(--btn-padding-xs);
    font-size: var(--btn-font-size-xs);
    border-radius: var(--btn-border-radius-sm);
}

.btn-sm {
    padding: var(--btn-padding-sm);
    font-size: var(--btn-font-size-sm);
    border-radius: var(--btn-border-radius-sm);
}

.btn-md {
    padding: var(--btn-padding-md);
    font-size: var(--btn-font-size-md);
    border-radius: var(--btn-border-radius);
}

.btn-lg {
    padding: var(--btn-padding-lg);
    font-size: var(--btn-font-size-lg);
    border-radius: var(--btn-border-radius);
}

/* Button Variants */
.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    opacity: 0.85;
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-primary);
}

.btn-secondary:hover {
    opacity: 0.85;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.85;
}

.btn-ghost {
    background: #f0f0f0;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: #e0e0e0;
}

.btn-ghost:active {
    background: #d0d0d0;
}

.btn-ghost.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Special Button States */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Label as Button */
label.btn {
    cursor: pointer;
}

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

/* Full Width Option */
.btn-block {
    width: 100%;
    display: flex;
}


/* Welcome View */
.welcome-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--text-slide-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.welcome-view.hidden {
    display: none;
}

/* Fade overlay for panel close animation */
.fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity var(--fade-to-black-duration) ease;
}

.fade-overlay.active {
    opacity: 1;
}

/* Import Modal - Full screen overlay */
.import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.import-modal-content {
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.import-modal h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.import-modal-message {
    font-size: var(--font-size-md);
    color: var(--text-light);
    margin-bottom: var(--space-lg);
    min-height: 1.5em;
}

.import-modal-progress {
    font-size: var(--font-size-sm);
    color: var(--accent);
    margin-bottom: var(--space-lg);
    min-height: 1.2em;
}

.import-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-xl);
}

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

.import-modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-xl);
}

.import-modal-actions button {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
}

.import-modal-actions .btn-primary {
    background: var(--accent);
    color: white;
}

.import-modal-actions .btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
}

.import-modal-actions .btn-secondary {
    background: var(--border);
    color: var(--text-primary);
}

.import-modal-actions .btn-secondary:hover {
    background: #d0d0d0;
}

.import-modal-actions .btn-danger {
    background: var(--danger);
    color: white;
}

.import-modal-actions .btn-danger:hover {
    background: #c44133;
}

.import-modal.success .import-spinner {
    border-top-color: var(--success);
    animation: none;
}

.import-modal.success h2 {
    color: var(--success);
}

.welcome-content {
    max-width: var(--text-slide-width);
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-white);
    margin-right: var(--panel-width);
}

.welcome-content h1 {
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: var(--font-weight-normal);
    margin-bottom: var(--space-lg);
}

.welcome-content p {
    font-size: clamp(1.2rem, 3vw, 2rem);
    opacity: 0.9;
}

/* Slideshow Styles */
.slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--photo-slide-bg);
    display: none;
    transition: opacity 0.3s ease;
}

.slideshow.active {
    display: block;
}

.slideshow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background var(--transition);
    pointer-events: none;
    z-index: 5;
}

.slideshow.dimmed .slideshow-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.slide-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-duration) ease-in-out;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide.transitioning {
    z-index: 1;
}

.slide img {
    max-width: 100%;
    max-height: 85%;
    object-fit: contain;
    border-radius: var(--photo-corner-radius);
}

/* Vintage Photo Styles - Random styling for photos */
/* These styles can be toggled on/off via the .vintage-photos class on the slide */

/* Base vintage photo wrapper - applies rotation and shadow */
.slide.vintage-photos img {
    /* Rotation and shadow will be set via inline styles for randomness */
    transition: transform 0.3s ease;
}

/* Style 1: No border (clean modern look) */
.slide.vintage-photos.photo-style-none img {
    border: none;
    background: none;
    padding: 0;
}

/* Style 2: Thick white border (Polaroid/old photo style) */
.slide.vintage-photos.photo-style-thick-border img {
    border: 20px solid white;
    background: white;
    padding: 20px;
    padding-bottom: 60px; /* Extra padding at bottom like Polaroid */
    box-sizing: content-box;
    border-radius: 2px;
}

/* Style 3: Jagged white border (vintage torn photo edge) */
.slide.vintage-photos.photo-style-jagged-border img {
    border: 15px solid white;
    background: white;
    padding: 15px;
    box-sizing: content-box;
    border-radius: 0;
    /* Create jagged edge effect using clip-path */
    clip-path: polygon(
        0% 2%, 1% 0%, 3% 1%, 5% 0%, 7% 2%, 9% 0%, 11% 1%, 13% 0%, 15% 2%,
        17% 1%, 19% 0%, 21% 2%, 23% 1%, 25% 0%, 27% 2%, 29% 1%, 31% 0%,
        33% 2%, 35% 1%, 37% 0%, 39% 2%, 41% 1%, 43% 0%, 45% 2%, 47% 1%,
        49% 0%, 51% 2%, 53% 1%, 55% 0%, 57% 2%, 59% 1%, 61% 0%, 63% 2%,
        65% 1%, 67% 0%, 69% 2%, 71% 1%, 73% 0%, 75% 2%, 77% 1%, 79% 0%,
        81% 2%, 83% 1%, 85% 0%, 87% 2%, 89% 1%, 91% 0%, 93% 2%, 95% 1%,
        97% 0%, 99% 2%, 100% 4%, 99% 6%, 100% 8%, 98% 10%, 100% 12%,
        99% 14%, 100% 16%, 98% 18%, 100% 20%, 99% 22%, 100% 24%, 98% 26%,
        100% 28%, 99% 30%, 100% 32%, 98% 34%, 100% 36%, 99% 38%, 100% 40%,
        98% 42%, 100% 44%, 99% 46%, 100% 48%, 98% 50%, 100% 52%, 99% 54%,
        100% 56%, 98% 58%, 100% 60%, 99% 62%, 100% 64%, 98% 66%, 100% 68%,
        99% 70%, 100% 72%, 98% 74%, 100% 76%, 99% 78%, 100% 80%, 98% 82%,
        100% 84%, 99% 86%, 100% 88%, 98% 90%, 100% 92%, 99% 94%, 100% 96%,
        98% 98%, 99% 100%, 97% 99%, 95% 100%, 93% 98%, 91% 100%, 89% 99%,
        87% 100%, 85% 98%, 83% 99%, 81% 100%, 79% 98%, 77% 99%, 75% 100%,
        73% 98%, 71% 99%, 69% 100%, 67% 98%, 65% 99%, 63% 100%, 61% 98%,
        59% 99%, 57% 100%, 55% 98%, 53% 99%, 51% 100%, 49% 98%, 47% 99%,
        45% 100%, 43% 98%, 41% 99%, 39% 100%, 37% 98%, 35% 99%, 33% 100%,
        31% 98%, 29% 99%, 27% 100%, 25% 98%, 23% 99%, 21% 100%, 19% 98%,
        17% 99%, 15% 100%, 13% 98%, 11% 99%, 9% 100%, 7% 98%, 5% 99%,
        3% 100%, 1% 98%, 0% 96%, 2% 94%, 0% 92%, 1% 90%, 0% 88%, 2% 86%,
        0% 84%, 1% 82%, 0% 80%, 2% 78%, 0% 76%, 1% 74%, 0% 72%, 2% 70%,
        0% 68%, 1% 66%, 0% 64%, 2% 62%, 0% 60%, 1% 58%, 0% 56%, 2% 54%,
        0% 52%, 1% 50%, 0% 48%, 2% 46%, 0% 44%, 1% 42%, 0% 40%, 2% 38%,
        0% 36%, 1% 34%, 0% 32%, 2% 30%, 0% 28%, 1% 26%, 0% 24%, 2% 22%,
        0% 20%, 1% 18%, 0% 16%, 2% 14%, 0% 12%, 1% 10%, 0% 8%, 2% 6%, 0% 4%
    );
}

.slide .caption {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-white);
    padding: var(--space-lg) 2rem;
    border-radius: 0.5rem;
    font-size: var(--font-size-xlarge);
    text-align: center;
    max-width: 80%;
}

.slide .caption.caption-relative {
    bottom: 2rem;
}

.slide .caption.caption-fixed {
    bottom: 4rem;
    position: fixed;
}

.slide.text-slide {
    padding: var(--space-2xl);
    text-align: center;
    font-size: var(--font-size-slideshow);
    line-height: var(--line-height-normal);
    color: var(--text-white);
}

.slide.text-slide > * {
    max-width: var(--text-slide-width);
    margin: 0 auto;
}

/* Text slide headings */
.slide.text-slide h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-lg);
}

.slide.text-slide h2 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-md);
}

.slide.text-slide h3 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-md);
}

/* Text slide lists */
.slide.text-slide ul,
.slide.text-slide ol {
    max-width: 66%;
    margin: var(--space-lg) auto;
    text-align: left;
    list-style-position: outside;
    padding-left: var(--space-xl);
}

.slide.text-slide ul {
    list-style-type: disc;
}

.slide.text-slide ol {
    list-style-type: decimal;
}

.slide.text-slide li {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-relaxed);
}

.slide.text-slide li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.slide.text-slide ul ul,
.slide.text-slide ol ol,
.slide.text-slide ul ol,
.slide.text-slide ol ul {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.slide.clock-slide {
    background: var(--text-slide-bg);
    color: var(--text-white);
    text-align: center;
}

.clock-time {
    font-size: var(--font-size-clock);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

.clock-date {
    font-size: var(--font-size-date);
    font-weight: var(--font-weight-normal);
    margin-top: 0;
    opacity: 0.9;
}

.clock-messages {
    margin-top: var(--space-2xl);
    display: flex;
    flex-direction: row;
    gap: var(--space-lg);
    justify-content: center;
    align-items: stretch;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.clock-message {
    flex: 1;
    border: 1px solid currentColor;
    border-radius: 0.5rem;
    padding: var(--space-md);
    text-align: center;
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.clock-message-date {
    font-size: clamp(0.625rem, 1.25vw, 0.875rem);
    font-weight: var(--font-weight-semibold);
}

.clock-message-text {
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    font-weight: var(--font-weight-normal);
    line-height: 1.4;
}

/* Scheduled slide indicator in list view */
.content-item.scheduled {
    position: relative;
}

.schedule-info {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: var(--space-xs);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.schedule-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: #4caf50;
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    width: 3rem;
    height: 5rem;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    opacity: 0.65;
    transition: opacity var(--transition), background var(--transition);
    z-index: 10;
}

@media (prefers-color-scheme: light) {
    .nav-btn {
        background: rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.2);
        color: #000000;
    }
    
    .nav-btn:hover,
    .nav-btn:focus {
        background: rgba(0, 0, 0, 0.2);
    }
    
    .settings-btn {
        color: #000000;
    }
}

@media (prefers-color-scheme: dark) {
    .nav-btn {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
    
    .nav-btn:hover,
    .nav-btn:focus {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .settings-btn {
        color: #ffffff;
    }
}

.nav-btn:hover,
.nav-btn:focus {
    opacity: 0.9;
}

.nav-btn.prev {
    left: 0;
    border-radius: 0 0.5rem 0.5rem 0;
    border-left: none;
}

.nav-btn.next {
    right: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: none;
}

/* Control Buttons (used in editor status bar) */
.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.control-btn svg {
    width: 100%;
    height: 100%;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.pause-btn.paused .pause-icon {
    display: none;
}

.pause-btn.paused .play-icon {
    display: block !important;
}

.pause-btn.paused {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.5);
}

/* Editor Status Bar */
.editor-status-bar {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    z-index: 15;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    gap: 1rem;
}

.status-bar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    grid-column: 1;
}

.status-bar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: 2;
}

.status-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    grid-column: 3;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.status-separator {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
}

.pending-indicator {
    color: #fbbf24;
    font-weight: 500;
}

.pending-dot {
    display: inline-block;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.push-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #3b82f6;
    border: 1px solid #2563eb;
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.push-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.push-btn:active {
    transform: translateY(0);
}

.push-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #6b7280;
    border-color: #4b5563;
}

.push-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.sync-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

.status-item.syncing {
    color: #3b82f6;
    font-weight: 500;
}

@media (max-width: 768px) {
    .editor-status-bar {
        padding: 0.5rem;
        font-size: 0.75rem;
        gap: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        grid-template-columns: minmax(0, auto) auto minmax(0, 1fr);
    }

    .status-bar-left {
        gap: 0.375rem;
    }

    .status-bar-left .control-btn,
    .status-bar-center .control-btn {
        width: 2rem;
        height: 2rem;
        padding: 0.375rem;
    }

    .status-bar-right {
        gap: 0.5rem;
    }

    .push-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .status-separator {
        display: none;
    }
}

/* Settings Panel */
.settings-panel {
    position: absolute;
    top: 0;
    right: -100%;
    width: min(100%, var(--panel-width));
    height: 100%;
    background: var(--panel-bg);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    transition: right var(--transition);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.settings-panel.open {
    right: 0;
}

.settings-panel.fading {
    transition: opacity var(--fade-to-black-duration) ease;
    opacity: 0;
}

.settings-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--panel-bg);
    z-index: 10;
}

.settings-header h1 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
}

.close-settings {
    /* Uses: btn btn-primary btn-md */
}

.settings-content {
    padding: var(--space-xl);
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.settings-content section {
    margin-bottom: var(--space-2xl);
}

.settings-content h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.settings-content h3 {
    font-size: var(--font-size-md);
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

/* Upload Section */
.upload-buttons {
    display: flex;
    gap: var(--space-lg);
}

.upload-btn {
    flex: 1;
}

/* Text Slide Creator */
.text-creator {
    background: #f5f5f5;
    padding: var(--space-lg);
    border-radius: 0.5rem;
}

.text-creator.hidden {
    display: none;
}

/* Scheduling Section */
.scheduling-section {
    /*margin-top: var(--space-lg);*/
	margin-top: 0;
    padding: var(--space-md);
    background: white;
    border: 1px solid var(--border);
	border-top: 0;
    border-radius: 0 0  0.25rem 0.25rem;
}

.scheduling-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-base);
}

.scheduling-checkbox input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.scheduling-options {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.scheduling-options.hidden {
    display: none;
}

.scheduling-options .form-group {
    margin-bottom: var(--space-md);
}

.scheduling-options .form-group:last-child {
    margin-bottom: 0;
}

.scheduling-options label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.form-control {
    width: 100%;
    padding: var(--space-sm);
    font-size: var(--font-size-base);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: white;
}

.form-control:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.schedule-status {
    margin-top: var(--space-md);
    padding: var(--space-sm);
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 0.25rem;
    font-size: var(--font-size-sm);
    color: #2e7d32;
    text-align: center;
}

.schedule-status:empty {
    display: none;
}

/* Plain Text Editor with Markdown */
.text-editor-textarea {
	display: block;
    width: 100%;
    min-height: 150px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    background: white;
    resize: vertical;
    line-height: 1.5;
}

.text-editor-textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.markdown-help {
    margin: 0 0 var(--space-sm) 0;
	padding: var(--space-md);
    background: var(--surface-light);
    /*border-radius: 0.25rem;*/
    font-size: var(--font-size-small);
    color: var(--text-secondary);
}

/* Photo Caption Dialog - removed, replaced with inline editing */

.text-options {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-lg) var(--space-0);
}

.text-options label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.text-options input[type="color"] {
    width: 3rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    cursor: pointer;
}

.text-actions {
    display: flex;
    gap: var(--space-lg);
}

.text-actions button {
	margin-top: var(--space-lg);
    flex: 1;
    /* Primary/Secondary variants applied via classes */
}

#save-text-slide {
    /* Uses: btn btn-primary btn-md btn-block */
}

#cancel-text-slide {
    /* Uses: btn btn-secondary btn-md btn-block */
}

/* Slideshow Settings */
.slideshow-settings label {
    display: block;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.slideshow-settings input[type="number"] {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    margin-top: 0.25rem;
}

.slideshow-settings input[type="checkbox"] {
    margin-right: var(--space-sm);
}

/* Content Management */
#content-management-section {
    min-height: calc(100vh - 400px);
}

.content-list {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: var(--space-sm);
    position: relative;
}

.content-list:empty::before {
    content: "No content yet. Add photos or text slides above.";
    display: block;
    text-align: center;
    color: var(--text-light);
    padding: var(--space-2xl);
    font-style: italic;
}

/* Processing overlay */
.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: 0.5rem;
}

.processing-content {
    text-align: center;
}

.processing-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.processing-text {
    margin-top: var(--space-lg);
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.content-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: #f9f9f9;
    border-radius: 0.25rem;
    margin-bottom: var(--space-sm);
    position: relative;
    transition: background var(--transition);
}

.content-item:hover,
.content-item:focus-within {
    background: #ececec;
}

.content-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    background: #e0e0e0;
}

/* Drag insertion indicator */
.drop-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    pointer-events: none;
    z-index: 10;
}

.drop-indicator::before,
.drop-indicator::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    top: -2.5px;
}

.drop-indicator::before {
    left: -4px;
}

.drop-indicator::after {
    right: -4px;
}

.drag-handle {
    color: #999;
    font-size: var(--font-size-lg);
    cursor: grab;
    padding-top: 0.25rem;
    user-select: none;
    -webkit-user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.content-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.content-item .content-info {
    flex: 1;
    min-width: 0;
}

.content-item .content-type {
    font-size: var(--font-size-small);
    color: var(--text-light);
    margin-bottom: var(--space-xs);
}

.content-item .caption-input {
    width: 100%;
    padding: var(--space-sm) 0.75rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: var(--font-size-small);
    font-family: var(--font-family);
}

.text-editor-inline {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    resize: vertical;
    background: white;
    line-height: 1.5;
}

.text-editor-inline:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.content-item button {
    height: 2rem;
    min-width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: var(--font-size-xl);
    font-weight: bold;
}

.content-item .text-preview {
    padding: var(--space-sm);
    background: var(--primary-bg);
    color: white;
    border-radius: 0.25rem;
    font-size: var(--font-size-small);
    max-height: 60px;
    overflow: hidden;
}

.content-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.content-actions button {
    padding: var(--space-sm) var(--space-sm);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: var(--font-size-small);
    white-space: nowrap;
}

.content-item button {
    padding: var(--space-sm);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: var(--font-size-sm);
	background-color: transparent;
    transition: background var(--transition);
}

.content-item button:hover {
	background-color: rgba(0,0,0,.1);
}

/* Advanced Settings */
.advanced-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--font-size-base);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-lg) var(--space-0) var(--space-lg);
    color: var(--accent);
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.advanced-toggle:hover {
    text-decoration: underline;
}

.advanced-toggle .chevron {
    transition: transform var(--transition);
}

.advanced-toggle.expanded .chevron {
    transform: rotate(90deg);
}

.advanced-settings {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.advanced-settings:not(.hidden) {
    max-height: none;
    overflow: visible;
}

/* Buttons in advanced settings styled as links */
.advanced-settings .btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.advanced-settings .btn-primary,
.advanced-settings label.btn-primary {
    color: var(--accent);
}

.advanced-settings .btn-primary:hover,
.advanced-settings label.btn-primary:hover {
    text-decoration: underline;
    opacity: 1;
}

.advanced-settings .btn-danger {
    color: var(--danger);
}

.advanced-settings .btn-danger:hover {
    text-decoration: underline;
    opacity: 1;
}

.advanced-settings .btn-secondary {
    color: var(--text-primary);
}

.advanced-settings .btn-secondary:hover {
    text-decoration: underline;
    opacity: 1;
}

.settings-group {
    background: #f9f9f9;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.settings-group h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-sm);
}

/* Collapsible section headers */
.settings-group h3.section-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    user-select: none;
}

.settings-group h3.section-toggle:hover {
    color: var(--accent);
}

.section-chevron {
    font-size: 0.75rem;
    transition: transform var(--transition);
}

.section-toggle.expanded .section-chevron {
    transform: rotate(90deg);
}

/* Collapsible section content */
.section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    margin-top: var(--space-lg);
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.settings-group label {
    display: block;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.settings-group input[type="checkbox"] {
    margin-right: var(--space-sm);
}

.settings-group input[type="color"] {
    width: 3rem;
    height: 2rem;
    margin-left: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    cursor: pointer;
}

/* Range Sliders */
.range-label {
    display: block;
    margin-bottom: var(--space-lg);
}

.range-label span {
    font-weight: var(--font-weight-medium);
    color: var(--accent);
}

.range-label input[type="range"] {
    width: 100%;
    margin-top: var(--space-sm);
}

/* Action Buttons */
.button-group {
    margin-bottom: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.action-btn {
    /* Uses: btn btn-primary btn-md */
}

.danger-btn {
    /* Uses: btn btn-danger btn-md */
}

label.action-btn {
    /* Handled by label.btn base class */
}

.cancel-btn {
    /* Uses: btn btn-secondary btn-md */
    margin-right: var(--space-sm);
}

.button-description {
    font-size: var(--font-size-small);
    color: var(--text-light);
    margin: var(--space-xs) var(--space-0) var(--space-md);
    font-style: italic;
}

/* Reset Confirmation */
#reset-app-container {
    margin-top: var(--space-lg);
}

.reset-confirm {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.25rem;
    padding: var(--space-lg);
    margin-top: var(--space-sm);
}

.reset-confirm.hidden {
    display: none;
}

.warning-text {
    color: var(--danger);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-lg);
}

/* Content Actions Toolbar - removed since delete all moved to advanced */

/* Dev Mode Version Indicator */
.dev-version {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    z-index: 200;
    cursor: pointer;
    transition: color var(--transition);
    display: none;
}

.dev-version.active {
    display: block;
}

.dev-version:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Sync Status */
.sync-status {
    padding: var(--space-lg);
    background: #f5f5f5;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: auto;
    flex-shrink: 0;
}

.offline-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
}

.offline .status-dot {
    background: #f39c12;
}

.version-info {
    color: var(--text-light);
    font-size: var(--font-size-small);
    margin-left: 0.25rem;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    opacity: 0;
    transition: opacity var(--transition);
}

.save-indicator.saving {
    opacity: 1;
}

.save-indicator.saving .save-status::before {
    content: "Saving...";
    color: var(--text-light);
}

.save-indicator.saved {
    opacity: 1;
}

.save-indicator.saved .save-status::before {
    content: "✓ Saved";
    color: var(--success);
}

.storage-info {
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

/* Remote Editing Mode Badge & Sync Status */
.mode-badge-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.mode-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary);
    color: white;
}

.sync-status-indicator {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-status-indicator.sync-pending {
    color: var(--warning, #f59e0b);
}

.sync-status-indicator.sync-syncing {
    color: var(--primary);
}

.sync-status-indicator.sync-synced {
    color: var(--success);
}

.sync-status-indicator.sync-error {
    color: var(--danger);
}

.sync-status-indicator.sync-offline {
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-panel {
        width: 100%;
    }
    
    .upload-buttons {
        flex-direction: column;
    }
}

/* Loading State */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: var(--font-size-xl);
    z-index: 1000;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* System Theme Support for Text Slides */
@media (prefers-color-scheme: light) {
    .text-slide:not(.custom-colors), 
    .clock-slide:not(.custom-colors) {
        background: white !important;
        color: black !important;
    }
}

@media (prefers-color-scheme: dark) {
    .text-slide:not(.custom-colors), 
    .clock-slide:not(.custom-colors) {
        background: black !important;
        color: white !important;
    }
}

/* Help text styling */
.help-text {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin: var(--space-xs) var(--space-0) var(--space-md) var(--space-xl);
    font-style: italic;
}

/* Advanced Settings Container */
#advanced-settings section {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    background: #fafafa;
}

#advanced-settings h3 {
    margin-top: 0;
}

/* Welcome message in panel */
.panel-welcome {
    background: #f0f8ff;
    padding: var(--space-lg);
    border-radius: 0.5rem;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    display: none;
}

.panel-welcome.show {
    display: block;
}

.panel-welcome h3 {
    margin: var(--space-0) var(--space-0) var(--space-sm) var(--space-0);
    color: var(--accent);
}

.panel-welcome p {
    margin: 0;
    color: var(--text-light);
}
/* API Log Panel */
.api-log-panel {
    position: fixed;
    bottom: 5rem;
    left: 1rem;
    right: 1rem;
    max-width: 600px;
    max-height: 400px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-family: "Courier New", monospace;
    font-size: 12px;
    z-index: 16;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    margin-left: auto;
    margin-right: auto;
}

.api-log-panel.minimized {
    max-height: 40px;
}

.api-log-header {
    background: #1a1a1a;
    padding: 8px 12px;
    border-bottom: 1px solid #00ff00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

.api-log-title {
    color: #00ff00;
    font-weight: bold;
    font-size: 13px;
}

.api-log-toggle,
.api-log-clear {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 2px 8px;
    margin-left: 8px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.2s;
}

.api-log-toggle:hover,
.api-log-clear:hover {
    background: #00ff00;
    color: #000;
}

.api-log-content {
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    color: #fff;
    line-height: 1.4;
}

.api-log-panel.minimized .api-log-content {
    display: none;
}

.api-log-entry {
    margin: 4px 0;
    padding: 4px 8px;
    border-radius: 3px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.api-log-entry.info {
    color: #00ff00;
}

.api-log-entry.success {
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

.api-log-entry.error {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.api-log-entry.warning {
    color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
}

.api-log-entry.viewer {
    border-left: 3px solid #00aaff;
}

.api-log-entry.editor {
    border-left: 3px solid #ff00ff;
}

.api-log-timestamp {
    color: #888;
    font-size: 10px;
    margin-right: 8px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .api-log-panel {
        max-height: 250px;
        bottom: 4rem;
        left: 0.5rem;
        right: 0.5rem;
        font-size: 10px;
    }

    .api-log-title {
        font-size: 11px;
    }
}
