/**
 * Forside (index.html)
 */

body.portal-hub-main,
body.portal-hub-main * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
}

body.portal-hub-main {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2980, #26d0ce);
    background-attachment: fixed;
    background-size: cover;
    color: white;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Dekorativ baggrund – kun desktop */
@media (min-width: 769px) {
    body.portal-hub-main {
        background:
            repeating-linear-gradient(
                45deg,
                rgba(255, 215, 0, 0.02) 0px,
                rgba(255, 215, 0, 0.02) 15px,
                rgba(0, 128, 0, 0.015) 15px,
                rgba(0, 128, 0, 0.015) 30px,
                rgba(178, 34, 34, 0.015) 30px,
                rgba(178, 34, 34, 0.015) 45px,
                rgba(255, 215, 0, 0.01) 45px,
                rgba(255, 215, 0, 0.01) 60px
            ),
            repeating-linear-gradient(
                45deg,
                transparent,
                transparent 25px,
                rgba(255, 255, 255, 0.015) 25px,
                rgba(255, 255, 255, 0.015) 50px
            ),
            linear-gradient(135deg, #1a2980, #26d0ce);
        background-attachment: fixed;
    }

    body.portal-hub-main::before {
        content: '🏃‍♂️🏃‍♀️🏃';
        position: fixed;
        inset: 0;
        font-size: 50px;
        color: rgba(255, 255, 255, 0.012);
        pointer-events: none;
        transform: rotate(-10deg) scale(1.5);
        letter-spacing: 30px;
        z-index: 0;
        opacity: 0.08;
        overflow: hidden;
        line-height: 90px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

body.portal-hub-main .main-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    position: relative;
    z-index: 10;
}

body.portal-hub-main .container {
    max-width: 1000px;
    width: 100%;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: 24px;
    padding: 20px 16px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
}

body.portal-hub-main .header {
    margin-bottom: 20px;
    animation: homeFadeIn 1s ease;
    position: relative;
}

body.portal-hub-main .header:has(.theme-toggle--header) {
    padding-right: 5.5rem;
}

body.portal-hub-main .logo {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

body.portal-hub-main h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

body.portal-hub-main .subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.45;
    padding: 0 4px;
}

body.portal-hub-main .instructions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

body.portal-hub-main .instructions h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

body.portal-hub-main .instructions p {
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

body.portal-hub-main .button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

body.portal-hub-main .row {
    display: grid;
    gap: 12px;
    width: 100%;
}

body.portal-hub-main .nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px 16px;
    text-decoration: none;
    color: white;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    min-height: 44px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    animation: homeFadeIn 0.8s ease backwards;
}

body.portal-hub-main .nav-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

body.portal-hub-main .nav-button:active {
    transform: scale(0.98);
}

body.portal-hub-main .button-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: white;
    flex-shrink: 0;
}

body.portal-hub-main .button-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.25;
}

body.portal-hub-main .button-description {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.4;
    max-width: 100%;
}

body.portal-hub-main .badge {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 8px;
}

body.portal-hub-main .submenu-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Knap-gradienter */
body.portal-hub-main .button-theory {
    background: linear-gradient(135deg, rgba(142, 68, 173, 0.85), rgba(241, 196, 15, 0.85));
}
body.portal-hub-main .button-1 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(139, 92, 246, 0.85));
}
body.portal-hub-main .button-2 {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.85), rgba(52, 152, 219, 0.85));
}
body.portal-hub-main .button-4 {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.85), rgba(22, 160, 133, 0.85));
}
body.portal-hub-main .button-5 {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.85), rgba(230, 126, 34, 0.85));
}
body.portal-hub-main .button-specific {
    background: linear-gradient(135deg, rgba(15, 76, 92, 0.9), rgba(42, 157, 143, 0.9));
}

body.portal-hub-main .footer {
    flex-shrink: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 12px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    z-index: 20;
}

body.portal-hub-main .footer p {
    margin: 0 auto;
    opacity: 0.9;
}

@keyframes homeFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* —— Mobil: én kolonne, kompakte kort —— */
body.portal-hub-main .row-2,
body.portal-hub-main .row-4 {
    grid-template-columns: 1fr;
}

body.portal-hub-main .nav-button {
    min-height: auto;
    padding: 18px 14px;
}

@media (min-width: 480px) {
    body.portal-hub-main .row-2 {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 769px) {
    body.portal-hub-main .main-content {
        justify-content: center;
        padding: 24px;
    }

    body.portal-hub-main .container {
        border-radius: 32px;
        padding: 28px 24px;
    }

    body.portal-hub-main .row-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    body.portal-hub-main .nav-button {
        min-height: 180px;
        padding: 24px 18px;
        border-radius: 20px;
    }

    body.portal-hub-main .nav-button:hover {
        transform: translateY(-4px);
    }

    body.portal-hub-main .button-icon {
        font-size: 2.6rem;
    }

    body.portal-hub-main .button-title {
        font-size: 1.3rem;
    }
}

@media (min-width: 900px) and (max-width: 1100px) {
    body.portal-hub-main .row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.portal-hub-main .nav-button,
    body.portal-hub-main .header {
        animation: none;
    }

    body.portal-hub-main .nav-button:hover {
        transform: none;
    }
}
