/* =========================================
   SETTINGS PAGE LAYOUT (like kana pages)
   ========================================= */

body {
    background: linear-gradient(to bottom, #fffafa, #f0f0f0);
    overflow-y: auto;
    font-family: 'Noto Sans JP', sans-serif;
}

.kana-page.settings-page {
    width: 94%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 8rem; /* space for bottom bar */
    opacity: 0;
    transform: translateY(10px);
    animation: settings-fade-in 1.2s ease-out forwards;
}

@keyframes settings-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* small green "saved" message */
.settings-save-message {
    margin-top: 0.8rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2e7d32;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.settings-save-message.hidden {
    opacity: 0;
    transform: translateY(-4px);
}

/* =========================================
   TITLES
   ========================================= */

.settings-title {
    margin: 0;
    padding-top: 0.5rem;

    font-size: clamp(2.2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    color: #5c2a2a;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);

    animation: idle-float-h1 5s ease-in-out infinite alternate,
               texture-flicker-h1 16s ease-in-out infinite alternate;
    animation-delay: 0.2s, 0.1s;
}

@keyframes idle-float-h1 {
    from { transform: translateY(6px); }
    to   { transform: translateY(-6px); }
}

@keyframes texture-flicker-h1 {
    0%   { background-position: 0% 0%; }
    50%  { background-position: 1% 1%; }
    100% { background-position: 0% 0%; }
}

/* section blocks inside settings */

.settings-form {
    margin-top: 1.4rem;
}

.settings-section {
    margin-bottom: 1.8rem;
}

.settings-subtitle {
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    color: #7a4b4b;
    margin-bottom: 0.8rem;
}

/* =========================================
   QUIZ TYPE TOGGLES
   ========================================= */

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 520px;
    margin: 0.4rem auto;
}

.settings-toggle-label {
    font-size: 0.95rem;
    color: #4f3a3a;
}

/* little iOS-style switch */

.toggle-switch {
    position: relative;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e0d4d4;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: #c78abf;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* =========================================
   KANA TILES
   ========================================= */

.kana-section-settings {
    margin-top: 2rem;
}

.settings-kana-group {
    margin-bottom: 1.3rem;
}

.settings-kana-heading {
    text-align: center;
    font-weight: 700;
    color: #5c2a2a;
    margin-bottom: 0.5rem;
}

.settings-kana-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 0.8rem;
}

/* tile styled like small version of kana-subcat-toggle */

.kana-set-tile {
    min-width: 140px;
    padding: 0.6rem 0.9rem;

    border-radius: 0.8rem;
    border: 2px solid #b48a8a;
    box-shadow: 0 3px 7px rgba(0,0,0,0.10);

    background:
        linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(252,231,231,0.95)),
        url('../../../includes/assets/textures/paper-texture.jpg');
    background-size: 200%;
    background-blend-mode: overlay;

    font-size: 0.9rem;
    font-weight: 600;
    color: #5c2a2a;
    text-align: center;
    cursor: pointer;

    transition: transform 0.15s ease,
                box-shadow 0.15s ease,
                background 0.15s ease;
}

.kana-set-tile.active {
    background:
        linear-gradient(to bottom, #ccf1cc, #a6e3a6),
        url('../../../includes/assets/textures/paper-texture.jpg');
    border-color: #72b672;
}

.kana-set-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* hide the actual checkbox; click label instead */
.kana-set-tile input {
    display: none;
}

/* =========================================
   BOTTOM BAR (copied 1:1 from kana-table)
   ========================================= */

.kana-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.97),
        rgba(255, 255, 255, 0.80),
        rgba(255, 255, 255, 0)
    );
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.08);

    border-top: 2px solid rgba(180, 138, 138, 0.6);

    padding: 0.6rem 0;
    display: flex;
    justify-content: center;
    z-index: 1001;
}

.bottom-btn {
    flex: 1 1 0;
    max-width: 520px;

    margin: 0 0.5rem;
    padding: 0.9rem 1rem;

    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #5c2a2a;

    border-radius: 0.9rem;
    border: 2px solid #b48a8a;

    background:
        linear-gradient(to bottom, rgba(249, 194, 194, 0.9), rgba(244, 122, 122, 0.9)),
        url('../../../includes/assets/textures/paper-texture.jpg');
    background-size: 200%;
    background-blend-mode: overlay;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    cursor: pointer;

    transition: transform 0.2s ease,
                box-shadow 0.2s ease,
                background 0.2s ease;
}

.bottom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
    background: linear-gradient(to bottom, #f9c2c2, #f6baba);
}

.bottom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 700px) {
    .kana-page.settings-page {
        padding: 1.5rem 0.5rem 7rem;
    }

    .settings-toggle-row {
        max-width: 100%;
    }

    .bottom-btn {
        max-width: none;
        font-size: 1rem;
        padding: 0.7rem 0.8rem;
    }
}
