/* --- FOBA Helper 2.0 Styles --- */

/* --- Fonts and Basics (inherit from site usually, but ensuring specifics) --- */
@import url('https://fonts.googleapis.com/css2?family=Iceberg&display=swap');

/* --- Shared Variables --- */
:root {
    --bg-color: #202124;
    --text-color: #fff;
    --accent-color: #FFA3A3;
    --header-bg: #1a1a1c;
    --border-color: #444;
    --filter-bg: #2b2c30;
    --card-hover: #3a3b40;
}

/* --- Common Layout Helpers --- */
.foba-container {
    width: 100%;
    max-width: 62.5rem;
    background: var(--header-bg);
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1.25rem rgba(0, 0, 0, 0.5);
    padding: 2rem;
    margin: 2rem auto;
    border: 0.062rem solid var(--border-color);
}

.foba-title {
    font-family: 'Iceberg', sans-serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 2rem;
}

.foba-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--filter-bg);
    color: var(--text-color);
    border: 0.062rem solid var(--accent-color);
    border-radius: 0.312rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin: 0.5rem;
    text-align: center;
    text-decoration: none;
}

.foba-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.foba-btn-primary {
    background: rgba(255, 163, 163, 0.1);
    width: 100%;
    margin: 0.5rem 0;
    text-align: left;
}

/* --- Psychotest Styles --- */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.625rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: bold;
}

.psychotest-input {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg-color);
    border: 0.062rem solid var(--border-color);
    color: var(--text-color);
    border-radius: 0.25rem;
    font-size: 1rem;
}

.keyword-card {
    background: var(--bg-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
    border-left: 0.188rem solid var(--accent-color);
}

/* --- Background Generator Styles --- */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-card {
    background: var(--filter-bg);
    border: 0.062rem solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.option-card:hover {
    background: var(--card-hover);
    border-color: var(--accent-color);
}

.option-card.selected {
    background: rgba(255, 163, 163, 0.2);
    border-color: var(--accent-color);
    box-shadow: 0 0 0.625rem rgba(255, 163, 163, 0.2);
}

.event-block {
    background: #2b2c30;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.result-card {
    background: var(--bg-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
    border-left: 0.188rem solid var(--accent-color);
}

/* Bold result fix */
.result-card strong,
.result-card b {
    color: var(--accent-color);
    font-weight: 700;
}

/* --- Disclaimer / Text Formatting --- */
.special-text {
    font-weight: bold;
    color: var(--accent-color);
}

/* --- Modules / Rule Book Navigation --- */

/* Main Layout for Rule Books */
.rules-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Sidebar Styling */
.rules-sidebar {
    width: 18.75rem;
    background: var(--header-bg);
    border: 0.062rem solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    flex-shrink: 0;
}

.rules-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 0.062rem solid var(--border-color);
    padding-bottom: 0.5rem;
}

.chapter-list {
    list-style: none;
    padding: 0;
}

.chapter-item {
    margin-bottom: 0.5rem;
}

.chapter-link {
    display: block;
    padding: 0.5rem;
    color: #ccc;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.chapter-link:hover,
.chapter-link.active {
    background: var(--filter-bg);
    color: var(--accent-color);
    padding-left: 0.8rem;
}

/* Act Headers in Sidebar */
.act-header {
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    cursor: default;
}

/* Content Area */
.rules-content {
    flex-grow: 1;
    min-width: 0;
    background: var(--header-bg);
    border: 0.062rem solid var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    min-height: 31.25rem;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.rule-text {
    font-size: 1rem;
    line-height: 1.65;
    color: #e5e5e7;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.rule-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 163, 163, 0.5) 0%, rgba(255, 163, 163, 0.15) 60%, transparent 100%);
    margin: 1rem 0;
    max-width: 100%;
}

.rule-divider-double {
    border: none;
    height: 3px;
    border-top: 1px solid rgba(255, 163, 163, 0.6);
    border-bottom: 1px solid rgba(255, 163, 163, 0.3);
    background: transparent;
    margin: 1.25rem 0;
    max-width: 100%;
}

.rules-content h2 {
    font-family: 'Iceberg', sans-serif;
    color: var(--accent-color);
    border-bottom: 0.062rem solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.rules-content img {
    /* Legacy styling, overridden by specific classes if used */
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    margin: 1rem 0;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.3);
}

.footnotes {
    margin-top: 3rem;
    padding: 1.5rem;
    border-top: 0.062rem solid var(--accent-color);
    font-size: 0.95rem;
    color: #ddd;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.25rem;
}

/* --- Screenshot Mode --- */
.screenshot-mode {
    background: #1a1a1c !important;
    color: #ffffff !important;
    padding: 1.25rem !important;
    border-radius: 0.5rem;
    width: 50rem !important;
    margin: 0 auto;
    opacity: 1 !important;
    filter: none !important;
    box-shadow: none !important;
}

.screenshot-mode .btn,
.screenshot-mode .foba-btn {
    display: none !important;
}

/* --- Module Cards (New Style) --- */
.module-card {
    min-height: 28.125rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover !important;
    background-position: center bottom !important;
    background-color: var(--filter-bg);
    position: relative;
    overflow: hidden;
    padding: 2.5rem;
    border: 0.062rem solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Smooth interaction */
}

/* Gradient Overlay - Darker at bottom for text readability */
.module-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
    transition: opacity 0.3s;
}

/* Hover State */
.module-card:hover {
    transform: translateY(-0.5rem) scale(1.01);
    box-shadow: 0 1.25rem 2.5rem rgba(255, 163, 163, 0.15);
    /* Glow using accent color */
    border-color: var(--accent-color);
}

.module-card:hover::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0.1) 100%);
}

/* Text Styling */
.module-card h2 {
    position: relative;
    z-index: 2;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.062rem;
    transition: color 0.3s;
}

.module-card p {
    position: relative;
    z-index: 2;
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.5;
    transition: color 0.3s;
}

.module-card:hover h2 {
    color: var(--accent-color);
    text-shadow: 0 0 0.625rem rgba(255, 163, 163, 0.5);
}

.module-card:hover p {
    color: #fff;
}

/* --- Rules Illustrations --- */
.rules-illustration {
    width: 100%;
    height: auto;
    display: block;
    margin: 2rem 0;
    /* Spacing */
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.938rem rgba(0, 0, 0, 0.5);
}

.foba-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.foba-btn-back {
    margin-left: 0;
}

/* --- Responsive & Mobile --- */
.sidebar-toggle {
    display: none;
    background: var(--filter-bg);
    border: 0.062rem solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

@media (max-width: 48rem) {
    body {
        overflow-x: hidden;
    }

    .content-container {
        width: 94% !important;
        max-width: 95vw !important;
        margin: 0 auto !important;
        padding: 1rem 0 !important;
        box-sizing: border-box !important;
    }

    .breadcrumbs-wrapper {
        width: 94% !important;
        max-width: 95vw !important;
        margin: 0 auto !important;
        padding: 0.5rem 0 0 !important;
        box-sizing: border-box !important;
    }

    .foba-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 1rem 0.75rem !important;
        border: 0.062rem solid var(--border-color) !important;
        border-radius: 0.5rem !important;
        box-sizing: border-box !important;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .foba-module-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
        width: 100%;
    }

    .foba-btn-back {
        margin: 0 !important;
        padding: 0.5rem 0.85rem !important;
        font-size: 0.875rem !important;
        min-height: 2.75rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .sidebar-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0.5rem 0.85rem !important;
        font-size: 0.875rem !important;
        min-height: 2.75rem !important;
    }

    .rules-layout {
        display: block !important;
        width: 100% !important;
        position: relative !important;
    }

    .rules-content {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        background: transparent !important;
        box-sizing: border-box !important;
    }

    .rules-content h2 {
        font-size: 1.4rem !important;
        line-height: 1.3 !important;
        padding: 0 0 0.75rem 0 !important;
        margin-bottom: 1rem !important;
        word-break: break-word;
    }

    .rule-text {
        font-size: 0.9375rem !important;
        line-height: 1.55 !important;
        padding: 0 !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .rule-divider {
        margin: 0.75rem 0 !important;
    }

    .rule-divider-double {
        margin: 0.9rem 0 !important;
    }

    /* Illustration on mobile */
    .rules-illustration {
        width: 100% !important;
        max-width: 100% !important;
        margin: 1.5rem 0 !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 0.25rem 0.938rem rgba(0, 0, 0, 0.5) !important;
    }

    .rules-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 82vw !important;
        max-width: 18.75rem !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-105%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 0.25rem 0 1.5rem rgba(0, 0, 0, 0.9) !important;
        overflow-y: auto !important;
        background: #18181b !important;
    }

    .rules-sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(4px) !important;
        z-index: 1040 !important;
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    .chapter-nav {
        flex-direction: column !important;
        gap: 0.75rem !important;
        margin-top: 1.5rem !important;
    }

    .chapter-nav .foba-btn {
        width: 100% !important;
        min-height: 2.75rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    .foba-title {
        font-size: 1.4rem !important;
        margin: 0 !important;
    }
}