/* ===============================
   Loading screen styles
   Used by index.html before Blazor starts.
   Depends on CSS custom properties from app.css.
   =============================== */

/* ===============================
    index.html
    Loading elements, should fit to LandingPage.razor.css
   =============================== */
.loading-page {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--bg-main);
    z-index: 9999;
    width: 100%;
    max-width: var(--page-max-width);
    margin: 0 auto;
}

.loading-page__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 50px);
    flex: 1;
    gap: 2rem;
    padding: 10px;
    color: var(--text-primary);
    width: 100%;
    max-width: var(--page-max-width);
    margin: 0 auto;
    overflow-y: auto;
}

.loading-page.fade-out {
    animation: loading-fade-out 0.4s ease-out forwards;
}

/* Loading Header (GlobalHeader の静的複製) */
.loading-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: var(--page-max-width);
    margin: 0 auto;
    flex-shrink: 0;
}

.loading-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

    .loading-header__logo:hover {
        filter: brightness(1.15);
    }

.loading-header__logo-svg {
    height: 1.5rem;
    width: auto;
}

.loading-header__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 12px;
}

.loading-header__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    white-space: nowrap;
}

    .loading-header__tab:hover {
        color: var(--text-primary);
        background: var(--bg-hover);
    }

.loading-header__tab-label {
    text-transform: uppercase;
}

/* タブレット (768px〜1279px) */
@media (min-width: 768px) and (max-width: 1279px) {
    .loading-header {
        padding: 6px 6px;
    }

    .loading-header__logo {
        font-size: 0.95rem;
    }

    .loading-header__nav {
        margin-left: 0px;
    }

    .loading-header__tab {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
}

/* スマホ (〜767px) */
@media (max-width: 767px) {
    .loading-header {
        padding: 6px 6px;
        gap: 4px;
    }

    .loading-header__logo {
        font-size: 0.95rem;
    }

    /* スマホではナビゲーションを非表示（リンク無効化） */
    .loading-header__nav {
        display: none;
    }
}

@keyframes loading-fade-out {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Hero section (matches .landing-hero) */
.loading-hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2em;
}

.loading-hero__title {
    font-size: clamp(3rem, 15vw, 8rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    background: var(--logo-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 1rem;
    margin: 0;
    line-height: 1.05;
}

.loading-hero__title-accent {
    -webkit-text-fill-color: var(--text-primary);
}

.loading-hero__description {
    font-size: clamp(0.875rem, 2vw, 1.5rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
    padding: 0 1.5rem;
    margin: 2rem 0 0;
    white-space: pre-line;
}

/* CTA button (matches .landing-hero__cta) */
.loading-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.9375rem 2.75rem;
    margin-top: 2rem;
    background: var(--cta-bg);
    color: var(--cta-color);
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.2s, filter 0.3s;
}

    .loading-hero__cta:hover {
        box-shadow: var(--loading-cta-glow);
        transform: translateY(-1px);
        filter: brightness(1.08);
    }

.loading-hero__cta-icon {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
}

/* Feature cards grid - Hero Banner Style */
.loading-feature-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: min(960px, 90vw);
    width: 100%;
}

.loading-feature-card {
    position: relative;
    display: block;
    min-height: 210px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    border: 2px solid var(--loading-card-border);
    box-shadow: 0 0 0 1px var(--loading-card-border-subtle);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
}

    .loading-feature-card:hover {
        border-color: var(--color-accent);
        box-shadow: 0 0 0 1px var(--loading-card-border-hover), var(--loading-card-glow);
        transform: translateY(-2px);
    }

/* Background image layer (matches .landing-card__bg) */
.loading-feature-card__bg {
    position: absolute;
    inset: 0;
    background-color: var(--bg-card);
    background-size: cover;
    background-position: right center;
    transition: transform 0.4s ease;
}

.loading-feature-card:hover .loading-feature-card__bg {
    transform: scale(1.03);
}

.loading-feature-card--visualizer .loading-feature-card__bg {
    background-image: var(--card-visualizer-bg);
}

.loading-feature-card--howitworks .loading-feature-card__bg {
    background-image: var(--card-howitworks-bg);
}

.loading-feature-card--history .loading-feature-card__bg {
    background-image: var(--card-history-bg);
}

.loading-feature-card--sortbasics .loading-feature-card__bg {
    background-image: var(--card-sortbasics-bg);
}

.loading-feature-card--lineage .loading-feature-card__bg {
    background-image: var(--card-lineage-bg);
}

.loading-feature-card--quiz .loading-feature-card__bg {
    background-image: var(--card-quiz-bg);
}

.loading-feature-card--pending {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--loading-card-border-subtle);
}

.loading-feature-card__overlay {
    position: absolute;
    inset: 0;
    background: var(--card-overlay-bg);
    pointer-events: none;
}

.loading-feature-card__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    z-index: 1;
}

.loading-feature-card__brand {
    position: absolute;
    top: 0;
    left: 0;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: var(--loading-brand-bg);
    padding: 0.75rem 0.75rem;
    border-radius: 0 0 8px 0;
    line-height: 1;
    z-index: 2;
}

.loading-feature-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.loading-feature-card__heading {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--logo-gradient);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.loading-feature-card__accent-line {
    width: 2.5rem;
    height: 3px;
    background: var(--logo-gradient);
    border-radius: 2px;
    margin-top: 0.125rem;
}

.loading-feature-card__text {
    font-size: clamp(0.75rem, 1.4vw, 0.875rem);
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 38ch;
    min-height: calc(1.5em * 2);
}

/* タブレット (768px〜1279px) */
@media (min-width: 768px) and (max-width: 1279px) {
    .loading-hero {
        margin-top: 1.5em;
    }

    .loading-feature-card {
        min-height: 190px;
    }

    .loading-feature-card__content {
        padding: 1.1rem 1.5rem;
    }
}

/* スマホ (〜640px) */
@media (max-width: 640px) {
    .loading-hero {
        margin-top: 1em;
    }

    .loading-feature-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .loading-feature-card {
        min-height: 170px;
    }

    .loading-feature-card__content {
        padding: 1rem 1.25rem;
    }
}

/* Privacy Badge (matches .landing-privacy) */
.loading-privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--color-accent-soft);
    border: 1px solid var(--loading-card-border);
    border-radius: 6px;
    font-size: clamp(0.75rem, 1.8vw, 0.95rem);
    font-weight: 500;
    color: var(--text-accent);
    max-width: min(600px, 85vw);
}

.privacy-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Progress track */
.loading-progress-track {
    width: min(260px, 70vw);
    height: 4px;
    margin-top: 1rem;
    background: var(--loading-progress-track);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    width: calc(var(--blazor-load-percentage, 0%) * 1);
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-sorted) 40%, var(--color-accent-hover) 60%, var(--color-sorted) 80%, var(--color-accent) 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px var(--loading-progress-glow);
    animation: progress-shimmer 1.8s linear infinite;
}

@keyframes progress-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.loading-progress-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* =============================================
   Loading Footer (Footer.razor の静的複製)
   ============================================= */
.loading-footer {
    align-self: stretch;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem 0.25rem 1.5rem;
    margin-top: auto;
    flex-shrink: 0;
}

.loading-footer__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--page-max-width, 1920px);
    margin: 0 auto;
}

.loading-footer__links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.loading-footer__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--color-accent);
}

.loading-footer__text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.loading-footer__link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.loading-footer__separator {
    color: var(--text-disabled);
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .loading-footer__content {
        flex-direction: row;
        justify-content: flex-end;
        gap: 1.5rem;
    }

    .loading-footer__links {
        justify-content: flex-end;
    }
}
