/* Presentation Editor Styles */
:root {
    --mahogany: #52382f;
    --mahogany-light: #7a5649;
    --mahogany-dark: #3a251e;
    --clay: #9c6f52;
    --sand: #d4a574;
    --sage: #8b9a7e;
    --light-bg: #f7f3ef;
    --dark-text: #2a1f1a;
    --border-color: #ebe5dd;
}

.presentation-editor {
    padding: 0;
    max-width: 100%;
    background-color: #ffffff;
}

.editor-header {
    background: linear-gradient(135deg, #ffffff 0%, #f7f3ef 100%);
    border-bottom: 2px solid var(--border-color);
    color: var(--dark-text);
    padding: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(82, 56, 47, 0.08);
}

.editor-header h1 {
    font-weight: 600;
    color: var(--mahogany);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.editor-header .text-muted {
    color: var(--mahogany-light) !important;
    font-size: 0.95rem;
    font-weight: 500;
}

.editor-header .bi-easel {
    color: var(--clay);
}

/* Header buttons alignment */
.editor-header .d-flex.gap-2 {
    align-items: center;
}

.editor-header .btn {
    height: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    line-height: 1.5;
}

.editor-header .btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
}

.editor-header .dropdown {
    display: inline-flex;
    align-items: center;
}

.editor-body {
    padding: 2rem 0;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    min-height: calc(100vh - 200px);
}

/* Slides List - Horizontal */
#slides-list {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: 0.5rem;
    padding: 1rem !important;
}

.slides-horizontal {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem;
    align-items: flex-start;
}

.slides-horizontal::-webkit-scrollbar {
    height: 8px;
}

.slides-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.slides-horizontal::-webkit-scrollbar-thumb {
    background: var(--clay);
    border-radius: 4px;
}

.slides-horizontal::-webkit-scrollbar-thumb:hover {
    background: var(--mahogany);
}

.slide-thumbnail {
    position: relative;
    min-width: 200px;
    max-width: 200px;
    border: 2px solid #e5e5e5;
    border-radius: 0.5rem;
    cursor: move;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.slide-thumbnail:hover {
    box-shadow: 0 4px 12px rgba(82, 56, 47, 0.2);
    transform: translateY(-2px);
    border-color: var(--clay);
}

.slide-thumbnail.active {
    border-color: var(--mahogany);
    box-shadow: 0 0 0 3px rgba(82, 56, 47, 0.2);
}

.slide-thumbnail.dragging {
    opacity: 0.5;
}

.slide-thumbnail-preview {
    aspect-ratio: 16 / 9;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    padding: 0.5rem;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
    color: white;
}

.slide-thumbnail-label {
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mahogany);
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.375rem 0.375rem;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Center the preview slide inside its column */
.slide-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: #ffffff;
}

.slide-preview {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background-color: var(--mahogany);
    border-radius: 0.5rem;
    box-shadow: 0 8px 20px rgba(82, 56, 47, 0.2);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: left;
    color: white;
    font-size: 2rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Center the block of lines but left-align individual lines */
.slide-lines {
    width: 100%;
    max-width: 820px;
    /* a bit smaller than slide max-width */
    margin: 0 auto;
    /* center the block horizontally within slide-content */
    text-align: left;
    /* ensure each line is left-aligned */
    white-space: pre-line;
}

.slide-lines div {
    /* ensure inner divs (created for chords/lyrics) are left-aligned */
    text-align: left;
    width: 100%;
}

/* Editor Controls */
.card {
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    color: var(--mahogany);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-header h6 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mahogany);
    margin: 0;
}

.card-header i {
    color: var(--clay);
    margin-right: 0.5rem;
}

/* Override main.css bg-primary for presentation editor specifically */
.presentation-editor .card-header.bg-primary {
    background: #f7f3ef !important;
    background-color: #f7f3ef !important;
    color: var(--mahogany) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.presentation-editor .card-header.bg-secondary {
    background: #faf8f6 !important;
    background-color: #faf8f6 !important;
    color: var(--mahogany) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.presentation-editor .card-header.bg-primary h6,
.presentation-editor .card-header.bg-secondary h6 {
    color: var(--mahogany) !important;
}

.presentation-editor .card-header.bg-primary i,
.presentation-editor .card-header.bg-secondary i,
.presentation-editor .card-header.bg-primary .bi,
.presentation-editor .card-header.bg-secondary .bi {
    color: var(--clay) !important;
}

.card-body {
    background-color: #ffffff;
}

/* Form Controls */
.form-label {
    color: var(--mahogany-dark);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.form-label.fw-bold,
.form-label.small {
    color: var(--mahogany);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--clay);
    box-shadow: 0 0 0 0.25rem rgba(156, 111, 82, 0.15);
}

.form-check-label {
    color: var(--dark-text);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background-color: var(--mahogany);
    border-color: var(--mahogany);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 2px 4px rgba(82, 56, 47, 0.15);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--mahogany-dark);
    border-color: var(--mahogany-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(82, 56, 47, 0.2);
}

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

.btn-outline-primary {
    color: var(--mahogany);
    border-color: var(--mahogany);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background-color: var(--mahogany);
    border-color: var(--mahogany);
    color: white;
    box-shadow: 0 2px 4px rgba(82, 56, 47, 0.2);
}

.btn-outline-secondary {
    color: var(--mahogany);
    border-color: var(--clay);
    background-color: #ffffff;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-outline-secondary:hover {
    background-color: var(--clay);
    border-color: var(--clay);
    color: white;
    box-shadow: 0 2px 4px rgba(156, 111, 82, 0.2);
}

.btn i {
    margin-right: 0.35rem;
}

/* Drag and Drop Visual Feedback */
.slide-thumbnail.drag-over {
    border-color: var(--sand);
    background-color: rgba(212, 165, 116, 0.1);
}

.slide-drop-indicator {
    height: 3px;
    background-color: var(--mahogany);
    margin: 0.5rem 0;
    border-radius: 1.5px;
    transition: all 0.2s ease;
}

/* Gradient Presets */
.gradient-sunset {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

.gradient-ocean {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-forest {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
}

.gradient-burgundy {
    background: linear-gradient(135deg, #56142a 0%, #8b3a5a 100%);
}

.gradient-royal {
    background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%);
}

/* Image Backgrounds (placeholders using patterns/colors) */
.bg-image-cross {
    background: radial-gradient(circle at 50% 50%, var(--mahogany-dark) 0%, var(--mahogany) 100%);
}

.bg-image-worship {
    background: linear-gradient(to bottom, #1a1a2e 0%, #16213e 100%);
}

.bg-image-bible {
    background: linear-gradient(135deg, #3d2817 0%, #5a3e2b 100%);
}

.bg-image-nature {
    background: linear-gradient(to bottom, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.bg-image-church {
    background: linear-gradient(135deg, #2d1b3d 0%, #4a2c5a 100%);
}



/* Responsive Design */
@media (max-width: 768px) {
    .editor-body {
        padding: 1rem 0;
    }

    .slide-preview-container {
        padding: 1rem;
        min-height: 250px;
    }

    .slide-preview {
        max-width: 100%;
    }

    .slide-content {
        padding: 1.5rem;
        font-size: 1rem !important;
        line-height: 1.4;
        overflow-y: auto;
        max-height: 250px;
    }

    .slide-content div {
        font-size: inherit !important;
    }

    .slides-horizontal {
        gap: 0.5rem;
    }

    .slide-thumbnail {
        min-width: 150px;
        max-width: 150px;
    }

    .editor-header {
        padding: 1rem 0;
    }

    .editor-header h1 {
        font-size: 1.2rem;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Font Family Previews */
select#font-family option:nth-child(1) {
    font-family: 'Inter', sans-serif;
}

select#font-family option:nth-child(2) {
    font-family: Georgia, serif;
}

select#font-family option:nth-child(3) {
    font-family: 'Merriweather', serif;
}

select#font-family option:nth-child(4) {
    font-family: 'Roboto', sans-serif;
}

select#font-family option:nth-child(5) {
    font-family: 'Playfair Display', serif;
}

/* Color Picker Styles */
.color-picker-wrapper {
    position: relative;
}

.color-picker-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.6rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.color-picker-btn:hover {
    border-color: var(--mahogany);
    box-shadow: 0 0 0 3px rgba(82, 56, 47, 0.1);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 0.25rem;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.color-hex {
    color: #495057;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.color-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border: 1px solid #e5e5e5;
    box-shadow: 0 4px 12px rgba(82, 56, 47, 0.15);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    color: var(--dark-text);
    font-weight: 500;
    transition: all 0.15s ease;
}

.dropdown-item:hover:not(.disabled) {
    background-color: #f7f3ef;
    color: var(--mahogany);
}

.dropdown-item i {
    margin-right: 0.5rem;
    color: var(--clay);
}

.dropdown-item.disabled {
    opacity: 0.5;
}

/* Section Dividers */
hr.section-divider,
.section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 1.25rem 0;
    opacity: 0.6;
}

/* Settings Sections */
.mb-3 {
    margin-bottom: 1.25rem !important;
}

.card-body .mb-3:last-child {
    margin-bottom: 0 !important;
}

/* Smooth Transitions and Animations */
.card {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.col-md-3 .card {
    animation-delay: 0.1s;
}

.col-md-9 .card:first-child {
    animation-delay: 0.2s;
}

.col-md-9 .card:last-child {
    animation-delay: 0.3s;
}