/* Games Page Styles */

.games-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--background-color);
    text-align: center;
    padding: 6rem 5% 3rem;
}

.games-hero h1,
.games-hero p {
    color: var(--background-color);
}

.games-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Category buttons */
.categories {
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.category-grid {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: var(--background-color);
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.category-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08), rgba(80, 227, 194, 0.08));
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.25);
}

.category-img-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-img-placeholder i {
    font-size: 2rem;
    color: var(--background-color);
}

.category-btn span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* ── Featured "Selber erstellen" CTA ─────────────────────────────────────
   The core product action. Pulled onto its own full-width row at the top
   (order:-1) and restyled as a filled brand-gradient banner so it visually
   dominates the three plain white browsing tiles below.                    */
.category-btn[data-category="erstellen"] {
    order: 1;                  /* sit below the other tiles (flex + grid) */
    flex: 0 0 100%;            /* claim the entire row so nothing sits beside it */
    flex-direction: row;       /* horizontal banner: icon + label + arrow */
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    max-width: none;           /* full-width row — must not share its line */
    margin: 1.5rem 0 0;
    padding: 1.75rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.35);
}

.category-btn[data-category="erstellen"] .category-img-placeholder {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.category-btn[data-category="erstellen"] .category-img-placeholder i {
    color: #fff;
}

.category-btn[data-category="erstellen"] span {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* Trailing arrow so it reads as a banner CTA rather than a tile */
.category-btn[data-category="erstellen"]::after {
    content: "\f061";          /* fa-arrow-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.1rem;
    color: #fff;
    transition: transform 0.3s ease;
}

.category-btn[data-category="erstellen"]:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 16px 40px rgba(74, 144, 226, 0.45);
}

.category-btn[data-category="erstellen"]:hover::after {
    transform: translateX(5px);
}

/* Keep the featured look in the active state — the generic .category-btn.active
   light-gradient rule must not flatten it. Higher specificity wins. */
.category-btn[data-category="erstellen"].active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.35);
}

/* Breadcrumb bar */
.breadcrumb-bar {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 5%;
}

.breadcrumb-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breadcrumb-back {
    background: none;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.breadcrumb-back:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: opacity 0.2s;
}

.breadcrumb-item:hover:not(.active) {
    opacity: 0.7;
}

.breadcrumb-item.active {
    font-weight: 600;
    color: var(--text-color);
    cursor: default;
}

.breadcrumb-sep {
    color: #aaa;
    font-size: 1rem;
}

/* Dynamic content area */
.category-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
    min-height: 300px;
}

/* Option grid (school levels, topics, events) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.option-card:hover:not(.disabled) {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.option-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.option-card span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
}

.option-card small {
    font-size: 0.75rem;
    color: #aaa;
    font-style: italic;
}

.option-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Sequence list */
.sequence-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sequence-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.sequence-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
    transform: translateX(4px);
}

.sequence-item-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.sequence-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sequence-item-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.lang-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--primary-color, #4a90e2);
    color: white;
    vertical-align: middle;
    margin-left: 0.35rem;
    opacity: 0.85;
}

.sequence-item-games {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.game-type-icon {
    width: 16px;
    height: 16px;
    color: #aaa;
    transition: color 0.2s;
    cursor: default;
    vertical-align: middle;
}

.game-type-icon:hover {
    color: var(--secondary-color);
}

.sequence-item-arrow {
    color: #ccc;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.sequence-item:hover .sequence-item-arrow {
    color: var(--primary-color);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #aaa;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Editor placeholder */
.editor-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed #d0d0d0;
}

.editor-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.editor-placeholder h3 {
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.editor-placeholder p {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-color);
    line-height: 1.6;
}

.editor-steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.editor-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.editor-step span {
    font-weight: 500;
    color: var(--text-color);
}

.editor-coming-soon {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Editor login button */
.editor-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.editor-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

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

/* Editor user bar (logged in state) */
.editor-user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f0f7ff;
    border-radius: 10px;
    border: 1px solid #d0e3f7;
}

.editor-user-greeting {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    background: transparent;
    color: #888;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-logout-btn:hover {
    background: #fee;
    border-color: #e88;
    color: #c44;
}

/* Responsive */
@media (max-width: 768px) {
    .games-hero {
        padding: 4rem 5% 2rem;
    }

    .games-hero h1 {
        font-size: 2rem;
    }

    .category-grid {
        gap: 1rem;
    }

    .category-btn {
        min-width: 130px;
        padding: 1rem 1.25rem;
    }

    .category-img-placeholder {
        width: 60px;
        height: 60px;
    }

    .category-img-placeholder i {
        font-size: 1.5rem;
    }

    .option-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .editor-steps {
        flex-direction: column;
        align-items: center;
    }

    .category-btn[data-category="erstellen"] {
        padding: 1.25rem 1.5rem;
    }

    .category-btn[data-category="erstellen"] span {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .category-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .category-btn {
        min-width: unset;
    }

    .category-btn[data-category="erstellen"] {
        grid-column: 1 / -1;   /* span both columns in the grid layout */
    }

    .option-grid {
        grid-template-columns: 1fr;
    }
}

/* Connecting overlay — shown immediately when "Selber erstellen" triggers the
   OIDC login, so the click has instant feedback during the redirect/cold start. */
.connecting-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.connecting-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.connecting-box i {
    font-size: 2.5rem;
}
