/* ============================================================
   INDUSTRIAL AUTOMATION MAIN MENU
   ============================================================ */

:root {
    --text-color: #1f2933;
    --muted-text: #5f6c7b;
    --bg-light: #fdfaf6;
    --page-surface: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(0, 0, 0, 0.1);
    --accent-blue: #0d6efd;
    --accent-gold: #ffd700;
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.16);
    --radius-lg: 18px;
    --radius-md: 12px;
    --transition-fast: 0.18s ease;
}

html[data-theme="dark"] {
    --text-color: #ffd700;
    --muted-text: #d7c76a;
    --bg-light: #1e1e1e;
    --page-surface: #242424;
    --card-bg: rgba(18, 18, 18, 0.92);
    --card-border: rgba(255, 215, 0, 0.24);
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.16), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(255, 215, 0, 0.16), transparent 28rem),
        var(--bg-light);
    color: var(--text-color);
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;

    background-color: #050505;
    cursor: pointer;
    overflow: hidden;

    animation: splashBackgroundShift 4s ease-in-out forwards;
    transition:
        opacity 0.65s ease,
        visibility 0.65s ease;
}

.splash-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(255, 215, 0, 0.18), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.2), transparent 28rem);
    pointer-events: none;
}

.splash-screen.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo-frame {
    position: relative;
    width: min(58vw, 390px);
    aspect-ratio: 1 / 1;
    z-index: 1;

    border-radius: 50%;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 4px solid rgba(255, 215, 0, 0.8);
    box-shadow:
        0 0 24px rgba(255, 215, 0, 0.48),
        0 0 60px rgba(255, 215, 0, 0.28);

    animation: splashFrameShift 4s ease-in-out forwards;
}

.splash-logo {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
    object-fit: cover;

    border-radius: 50%;

    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.splash-logo-dark {
    opacity: 1;
    filter:
        drop-shadow(0 0 22px rgba(255, 215, 0, 0.65))
        drop-shadow(0 0 48px rgba(255, 215, 0, 0.35));
    animation: splashDarkLogoFade 4s ease-in-out forwards;
}

.splash-logo-light {
    opacity: 0;
    filter:
        drop-shadow(0 0 18px rgba(0, 0, 0, 0.28))
        drop-shadow(0 0 36px rgba(255, 255, 255, 0.55));
    animation: splashLightLogoFade 4s ease-in-out forwards;
}

.splash-tap-text {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0.55rem 0.95rem;

    color: #1f2933;
    background-color: rgba(255, 255, 255, 0.78);
    border-radius: 999px;

    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;

    opacity: 0;
    animation: splashTapTextFade 4s ease-in-out forwards;
}

body.splash-active {
    overflow: hidden;
}

/* ============================================================
   MAIN MENU
   ============================================================ */

.menu-wrapper {
    width: min(1180px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
}

.menu-hidden {
    display: none;
}

.menu-hero {
    text-align: center;
    margin: 1rem auto 1.5rem;
}

.menu-hero h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 5vw, 3.75rem);
    line-height: 1.05;
}

.menu-hero p {
    max-width: 760px;
    margin: 0 auto 1.35rem;
    color: var(--muted-text);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.45;
}

.menu-search-box {
    width: min(100%, 820px);
    margin: 0 auto;
}

#menuSearch {
    width: 100%;
    padding: 1.05rem 1.25rem;

    border: 2px solid var(--card-border);
    border-radius: 999px;

    background-color: #ffffff;
    color: #111111;

    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 700;

    box-shadow: var(--shadow-soft);
}

#menuSearch:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow:
        0 0 0 4px rgba(13, 110, 253, 0.2),
        var(--shadow-soft);
}

html[data-theme="dark"] #menuSearch {
    background-color: #2c2c2c;
    color: var(--accent-gold);
}

/* ============================================================
   MENU CARDS
   ============================================================ */

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 1rem;
}

.menu-card {
    display: block;
    min-height: 250px;
    padding: 1.15rem;

    background-color: var(--card-bg);
    color: var(--text-color);

    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);

    text-align: left;
    text-decoration: none;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.menu-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.featured-card {
    border: 2px solid rgba(13, 110, 253, 0.55);
}

.menu-card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.menu-card h2 {
    margin: 0 0 0.55rem;
    font-size: 1.25rem;
}

.menu-card p {
    margin: 0 0 0.8rem;
    color: var(--muted-text);
    line-height: 1.4;
}

.menu-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-card li {
    padding: 0.25rem 0;
    font-weight: 700;
}

.menu-card span,
.small-card-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--accent-blue);
    font-weight: 800;
    text-decoration: none;
}

.no-results-message {
    display: none;
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--muted-text);
    font-weight: 800;
}

.no-results-message.visible {
    display: block;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);

    white-space: nowrap;
    border: 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes splashFrameShift {
    0% {
        border-color: rgba(255, 215, 0, 0.85);
        box-shadow:
            0 0 24px rgba(255, 215, 0, 0.5),
            0 0 60px rgba(255, 215, 0, 0.28);
    }

    100% {
        border-color: rgba(120, 120, 120, 0.55);
        box-shadow:
            0 0 22px rgba(0, 0, 0, 0.18),
            0 0 55px rgba(255, 255, 255, 0.45);
    }
}

@keyframes splashBackgroundShift {
    0% {
        background-color: #050505;
    }

    45% {
        background-color: #0e0d08;
    }

    68% {
        background-color: #c8c2a8;
    }

    100% {
        background-color: #fdfaf6;
    }
}

@keyframes splashDarkLogoFade {
    0% {
        opacity: 1;
        transform: scale(0.94);
    }

    38% {
        opacity: 1;
        transform: scale(1);
    }

    58%,
    100% {
        opacity: 0;
        transform: scale(1.04);
    }
}

@keyframes splashLightLogoFade {
    0%,
    42% {
        opacity: 0;
        transform: scale(0.94);
    }

    68%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splashTapTextFade {
    0%,
    55% {
        opacity: 0;
        transform: translateY(8px);
    }

    75%,
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {
    .menu-wrapper {
        padding: 1rem;
    }

    .splash-logo-frame {
        width: min(78vw, 320px);
    }

    .splash-tap-text {
        font-size: 0.85rem;
    }

    .menu-card {
        min-height: auto;
    }
}

/* ============================================================
   SAVED BOARDS LIST
   ============================================================ */

.saved-boards-list {
    display: grid;
    gap: 1rem;
    width: min(100%, 900px);
    margin: 0 auto;
}

.saved-board-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;

    padding: 1.15rem;

    background-color: var(--card-bg);
    color: var(--text-color);

    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);

    text-decoration: none;

    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.saved-board-card:hover {
    transform: translateY(-3px);
    border-color: rgba(13, 110, 253, 0.45);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.saved-board-main h2 {
    margin: 0 0 0.5rem;
}

.saved-board-main p {
    margin: 0.3rem 0;
    color: var(--muted-text);
}

.saved-board-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;

    font-weight: 800;
    color: var(--accent-blue);
}

@media (max-width: 700px) {
    .saved-board-card {
        flex-direction: column;
    }

    .saved-board-meta {
        align-items: flex-start;
    }
}