:root {
    --bg-color: #f7f8fc;
    --text-color: #333;
    --primary-color: #4f46e5;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --input-focus-border: var(--primary-color);
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

html.theme-dark {
    --bg-color: #111827;
    --text-color: #d1d5db;
    --primary-color: #6366f1;
    --border-color: #374151;
    --card-bg: #1f2937;
    --input-bg: #374151;
    --input-border: #4b5563;
    --input-focus-border: var(--primary-color);
}

html.theme-sepia {
    --bg-color: #fbf0d9;
    --text-color: #5b4636;
    --primary-color: #d55f3e;
    --border-color: #d3c0a6;
    --card-bg: #f4e8d1;
    --input-bg: #f4e8d1;
    --input-border: #d3c0a6;
    --input-focus-border: var(--primary-color);
}

html.theme-blueprint {
    --bg-color: #002b5b;
    --text-color: #ffffff;
    --primary-color: #ffd700;
    --border-color: #1a3d7b;
    --card-bg: #003f88;
    --input-bg: #002b5b;
    --input-border: #1a3d7b;
    --input-focus-border: var(--primary-color);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

select,
button {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

html.theme-dark select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23d1d5db' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

html.theme-sepia select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%235b4636' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

html.theme-blueprint select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}


#export-btn {
    padding: 0.5rem 1.25rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

html.theme-blueprint #export-btn {
    color: #000;
}

#export-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.slide-editor {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: border-color 0.3s, background-color 0.3s;
    display: none;
}

.slide-editor.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-editor legend {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    padding: 0 0.5rem;
    margin-left: 0;
}

.slide-editor p,
.slide-editor label,
.slide-editor ol {
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.slide-editor label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}


input[type="text"],
textarea {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus-border) 20%, transparent);
}

input[type="text"]:not(.long-input), .slide-editor ol input[type="text"] {
    width: 250px;
}

.long-input, input[readonly], textarea, .slide-editor ol {
    width: 100%;
    box-sizing: border-box;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[readonly] {
    background-color: color-mix(in srgb, var(--bg-color) 50%, var(--card-bg));
    font-style: italic;
    cursor: not-allowed;
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
}

input[readonly]:focus {
    box-shadow: none;
    border-color: var(--input-border);
}


.slide-editor ol {
    list-style: decimal;
    padding-left: 20px;
}
.slide-editor ol li {
    padding-left: 0.5rem;
    margin-bottom: 0.75rem;
}

#pagination-controls {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

#progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--input-border);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: background-color 0.3s;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease-in-out, background-color 0.3s;
}

.pagination-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#pagination-controls button {
    padding: 0.6rem 1.5rem;
    min-width: 120px;
    text-align: center;
}

#pagination-controls button:disabled {
    background-color: var(--input-border);
    color: color-mix(in srgb, var(--text-color) 50%, transparent);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--text-color) 70%, transparent);
}

footer p {
    margin: 0;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}
