/**
 * Slideshow Core Styles
 * Gemeinsame Styles für alle Lern-Slideshows
 */

/* ===== Grundschrift Font ===== */
@font-face {
    font-family: 'GrundschriftRegular';
    src: url('../../assets/fonts/GrundschriftRegular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Font Rendering Optimizations */
.syllable.grundschrift,
.math-task.grundschrift {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-smooth: always;
    -webkit-text-stroke: 0;
}

/* ===== CSS Custom Properties ===== */
:root {
    --fade-duration: 0.5s;
    --primary-color: #116e77;
    --primary-hover: #0f626a;
    --bg-color: #FFFFFF;
    --text-color: #333333;
    --modal-bg: #FFFFFF;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --content-font-size: 6rem;
    --nav-height: 60px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow: hidden;
}

/* ===== Navigation Bar ===== */
nav.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

nav.app-nav .nav-left,
nav.app-nav .nav-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

nav.app-nav .nav-center {
    flex: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.icon-btn i {
    font-size: 1.5rem;
    line-height: 1;
}

.icon-btn:hover {
    transform: scale(1.1);
    color: var(--primary-color);
}

.settings-btn:hover {
    transform: rotate(90deg) !important;
}

/* ===== Slideshow Container ===== */
/* Main container for all slideshow content, positioned below navbar */
.slideshow-container {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* ===== Main Container (Start Screen) ===== */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.start-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    text-transform: none;
}

.start-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ===== Center Play Button (when paused) ===== */
.center-play-btn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-play-btn i {
    font-size: 3rem;
    line-height: 1;
}

.center-play-btn:hover {
    background-color: var(--primary-hover);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* ===== Content Display Base ===== */
.content-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ===== Modal System ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background-color: var(--modal-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* ===== Settings Groups ===== */
.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
}

.setting-group .value-display {
    display: inline-block;
    margin-left: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* ===== Range Sliders ===== */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #E0E0E0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* ===== Modal Buttons ===== */
.close-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
    min-height: 44px;
    text-transform: none;
}

.close-btn:hover {
    background-color: var(--primary-hover);
}

/* ===== Info Modal Content ===== */
.info-content {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-content strong {
    color: var(--primary-color);
}

/* ===== Custom Radio Button Groups ===== */
.radio-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.radio-option {
    cursor: pointer;
    user-select: none;
    padding: 0.625rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.radio-option:hover:not(.active) {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

fieldset.setting-group {
    border: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

fieldset.setting-group legend {
    padding: 0;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 1rem;
}

fieldset.setting-group small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* ===== Checkbox Groups ===== */
.checkbox-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.checkbox-option {
    cursor: pointer;
    user-select: none;
    padding: 0.625rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.checkbox-option:hover:not(.active) {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

/* ===== Checkbox Grid (for letter selection) ===== */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-grid-item {
    cursor: pointer;
    user-select: none;
    padding: 0.75rem;
    border: 2px solid #E0E0E0;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.checkbox-grid-item input[type="checkbox"] {
    display: none;
}

.checkbox-grid-item:has(input:checked) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.checkbox-grid-item:hover:not(:has(input:checked)) {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .modal {
        padding: 1.5rem;
    }

    nav.app-nav {
        padding: 0 0.5rem;
    }

    nav.app-nav .nav-center {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    nav.app-nav .nav-left,
    nav.app-nav .nav-right {
        gap: 0.25rem;
    }

    .icon-btn {
        font-size: 1.25rem;
        padding: 0.25rem;
        min-width: 40px;
        min-height: 40px;
    }

    .icon-btn i {
        font-size: 1.25rem;
    }

    .center-play-btn {
        width: 80px;
        height: 80px;
    }

    .center-play-btn i {
        font-size: 2.5rem;
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }

    .checkbox-grid-item {
        padding: 0.5rem;
        font-size: 1rem;
    }
}
