/* Hub Specific Styles - Artistic Glass Theme */

body {
    background-color: #FFF8E7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        /* Paper texture overlay */
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.025"/></svg>'),
        /* Subtle paper lines */
        repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(139, 120, 93, 0.03) 2px,
            rgba(139, 120, 93, 0.03) 4px),
        /* Paper grain */
        radial-gradient(circle at 1px 1px, rgba(139, 120, 93, 0.01) 1px, transparent 0);
    background-size: 100px 100px, 100% 40px, 20px 20px;
}

.hub-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hub-title {
    display: none;
}

.main-content {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 100vh;
    width: 100%;
    align-items: flex-start;
    max-height: 100vh;
    overflow: hidden;
}

.left-section {
    width: 40%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px 10px 20px;
    background: transparent;
    overflow: hidden;
    gap: 0;
}

.kid-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: calc(100vh - 120px);
    margin-top: -120px;
    position: relative;
    z-index: 1;
    /* Kid image overlaps logo's transparent areas */
}

.brand-logo {
    max-width: 75%;
    height: auto;
    margin-bottom: 0;
    margin-top: 0;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: floatLogo 6s ease-in-out infinite;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    /* Logo at top with transparent background - kid image can overlap */
}

@keyframes floatLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.right-section {
    width: 60%;
    flex-shrink: 0;
    padding: 30px 30px;
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

@media (max-width: 1024px) {
    .right-section {
        padding: 30px 20px;
    }
}

.tabs-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

/* Tabs Header */
.tabs-header {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
    border-radius: 60px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.5);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tabs-header::-webkit-scrollbar {
    display: none;
}

.tab-button {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: none;
    background: transparent;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #6B7C8A;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover::before {
    opacity: 1;
}

.tab-button:hover {
    color: #5A4A42;
    transform: translateY(-2px);
}

.tab-button.active {
    background: linear-gradient(135deg, #FFF8E7, #FFE8B4);
    color: #5A4A42;
    box-shadow: 0 4px 12px rgba(255, 200, 87, 0.3);
    transform: translateY(-2px);
    font-weight: 700;
}

.tab-button.active::before {
    opacity: 0;
}

.tab-button:focus {
    outline: 3px solid rgba(255, 200, 87, 0.5);
    outline-offset: 2px;
}

.tab-icon {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-button:hover .tab-icon {
    transform: scale(1.1);
}

.tab-button.active .tab-icon {
    transform: scale(1.15);
}

.tab-label {
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Tab Content */
.tab-content {
    display: none;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 15px;
    width: 100%;
    height: fit-content;
    overflow: visible;
}

@media (max-width: 1200px) {
    .game-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 15px;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .game-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 12px;
        overflow: visible;
    }
}

/* Stories Tab Content */
.science-menu,
.stories-menu {
    width: 100%;
    padding: 20px 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(250, 248, 245, 0.8);
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.empty-title {
    font-size: 2rem;
    color: #5A4A42;
    margin: 0 0 10px 0;
    font-family: var(--font-heading);
}

.empty-description {
    font-size: 1.2rem;
    color: #546E7A;
    margin: 0;
    font-family: var(--font-body);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}


/* 3D Game Card Design */
.game-card {
    background: #FAF8F5;
    border: 3px solid;
    border-radius: 20px;
    overflow: visible;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    cursor: pointer;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    min-height: 220px;
    transform: perspective(1000px) rotateX(2deg) translateY(0);
    transform-style: preserve-3d;
    isolation: isolate;
}

/* Sequence Number Badge */
.sequence-number {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #FF7043 0%, #FF5722 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-heading);
    z-index: 1000;
    box-shadow: 
        0 6px 16px rgba(255, 112, 67, 0.5),
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    border: 4px solid white;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    line-height: 1;
    pointer-events: none;
    transform: translateZ(100px);
    will-change: transform;
}

.game-card:hover .sequence-number {
    transform: translateZ(100px) scale(1.15) rotate(-8deg);
    box-shadow: 
        0 8px 20px rgba(255, 112, 67, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.35),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

/* 3D depth shadow */
.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

/* 3D highlight effect */
.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

.game-card:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-8px) scale(1.02);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-width: 4px;
}

.game-card:hover::before {
    opacity: 0.8;
}

.game-card:hover::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
}

.game-card:active {
    transform: perspective(1000px) rotateX(2deg) translateY(-4px) scale(1.01);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.15),
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.game-card:focus {
    outline: 3px dashed var(--color-primary);
    outline-offset: 4px;
    border-radius: 20px;
}

.game-thumbnail {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    z-index: 3;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    transform: translateZ(20px);
}

.game-info {
    z-index: 3;
}

.game-card:hover .game-thumbnail {
    transform: translateZ(30px) scale(1.05);
}

/* Hand-drawn underline for thumbnail */
.game-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: currentColor;
    opacity: 0.2;
    border-radius: 2px;
    transform: scaleY(0.5);
    transform-origin: center;
}

.game-info {
    padding: 20px 18px;
    text-align: center;
    background: linear-gradient(180deg, rgba(250, 248, 245, 0.95) 0%, #FAF8F5 100%);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 3;
    border-radius: 0 0 20px 20px;
    min-height: 100px;
    transform: translateZ(10px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.game-title {
    font-size: 1.6rem;
    color: #3A4A5C;
    margin: 0 0 10px 0;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
}

/* Hand-drawn underline for title */
.game-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: currentColor;
    opacity: 0.15;
    border-radius: 1px;
    transform: scaleY(0.6);
}

.game-description {
    font-size: 1rem;
    color: #6B7A8A;
    margin: 0 0 8px 0;
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.6;
}

.game-age {
    font-size: 0.85rem;
    color: #9BC4D4;
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Soft, Muted Hand-Drawn Card Colors - Easy on the Eyes */
.card-shapes {
    border: 3px solid #9BC4D4;
}

.card-shapes .game-thumbnail {
    background: linear-gradient(135deg, #D4E8F0 0%, #B8D9E8 50%, #9BC4D4 100%);
    color: #5A8FA5;
}

.card-icon-shapes {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-wrap: wrap;
    line-height: 1;
}

.card-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 15px;
}

.card-shapes {
    border-color: #9BC4D4;
}

.card-shapes:hover {
    box-shadow:
        0 16px 32px rgba(155, 196, 212, 0.3),
        0 8px 16px rgba(155, 196, 212, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #7BA8B8;
}

.card-patterns {
    border-color: #FFB74D;
}

.card-patterns .game-thumbnail {
    background: linear-gradient(135deg, #FFE0B2 0%, #FFCC80 50%, #FFB74D 100%);
    color: #E65100;
}

.card-patterns:hover {
    box-shadow:
        0 16px 32px rgba(255, 183, 77, 0.3),
        0 8px 16px rgba(255, 183, 77, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #FF9800;
}

.card-chains {
    border-color: #81C784;
}

.card-chains .game-thumbnail {
    background: linear-gradient(135deg, #C8E6C9 0%, #A5D6A7 50%, #81C784 100%);
    color: #2E7D32;
}

.card-chains:hover {
    box-shadow:
        0 16px 32px rgba(129, 199, 132, 0.3),
        0 8px 16px rgba(129, 199, 132, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #66BB6A;
}

.card-tubes {
    border-color: #BA68C8;
}

.card-tubes .game-thumbnail {
    background: linear-gradient(135deg, #E1BEE7 0%, #CE93D8 50%, #BA68C8 100%);
    color: #7B1FA2;
}

.card-tubes:hover {
    box-shadow:
        0 16px 32px rgba(186, 104, 200, 0.3),
        0 8px 16px rgba(186, 104, 200, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #AB47BC;
}

.card-code {
    border-color: #FF8A65;
}

.card-code .game-thumbnail {
    background: linear-gradient(135deg, #FFCCBC 0%, #FFAB91 50%, #FF8A65 100%);
    color: #D84315;
}

.card-code:hover {
    box-shadow:
        0 16px 32px rgba(255, 138, 101, 0.3),
        0 8px 16px rgba(255, 138, 101, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #F4511E;
}

.card-memory {
    border-color: #4DD0E1;
}

.card-memory .game-thumbnail {
    background: linear-gradient(135deg, #B2EBF2 0%, #80DEEA 50%, #4DD0E1 100%);
    color: #0097A7;
}

.card-memory:hover {
    box-shadow:
        0 16px 32px rgba(77, 208, 225, 0.3),
        0 8px 16px rgba(77, 208, 225, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #26C6DA;
}

.card-shadow {
    border-color: #7986CB;
}

.card-shadow .game-thumbnail {
    background: linear-gradient(135deg, #C5CAE9 0%, #9FA8DA 50%, #7986CB 100%);
    color: #283593;
}

.card-shadow:hover {
    box-shadow:
        0 16px 32px rgba(121, 134, 203, 0.3),
        0 8px 16px rgba(121, 134, 203, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #5C6BC0;
}

.card-logic-lab {
    border-color: #7E57C2;
}

.card-logic-lab .game-thumbnail {
    background: linear-gradient(135deg, #D1C4E9 0%, #B39DDB 50%, #7E57C2 100%);
    color: #512DA8;
}

.card-logic-lab:hover {
    box-shadow:
        0 16px 32px rgba(126, 87, 194, 0.3),
        0 8px 16px rgba(126, 87, 194, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #5E35B1;
}

.card-physics {
    border-color: #FF7043;
}

.card-physics .game-thumbnail {
    background: linear-gradient(135deg, #FFAB91 0%, #FF8A65 50%, #FF7043 100%);
    color: #BF360C;
}

.card-physics:hover {
    box-shadow:
        0 16px 32px rgba(255, 112, 67, 0.3),
        0 8px 16px rgba(255, 112, 67, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #D84315;
}

.card-space {
    border-color: #5C6BC0;
}

.card-space .game-thumbnail {
    background: linear-gradient(135deg, #9FA8DA 0%, #7986CB 50%, #5C6BC0 100%);
    color: #283593;
}

.card-space:hover {
    box-shadow:
        0 16px 32px rgba(92, 107, 192, 0.3),
        0 8px 16px rgba(92, 107, 192, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: #3F51B5;
}

.game-card[href="#"] {
    pointer-events: none;
    opacity: 0.5;
    cursor: default;
    filter: grayscale(0.4);
    position: relative;
}

.game-card[href="#"]::after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    z-index: 10;
    opacity: 0.7;
}

.game-card[href="#"]:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-width: 3px;
}

.game-card[href="#"]:hover .game-thumbnail {
    transform: none;
}

/* Category cards styling */
.category-card {
    pointer-events: all;
    opacity: 1;
    cursor: pointer;
    filter: none;
}

.category-card:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-8px) scale(1.02);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.2),
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-width: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .hub-title {
        position: static;
        font-size: 2.5rem;
        transform: rotate(0deg);
        margin-bottom: 20px;
        text-align: center;
    }

    .main-content {
        flex-direction: column;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .left-section {
        width: 100%;
        flex: 0 0 auto;
        min-height: auto;
        padding: 5px 20px 10px 20px;
        background: transparent;
        justify-content: flex-start;
    }

    .kid-image {
        max-width: 90%;
        max-height: calc(100vh - 140px);
        margin-top: -90px;
        position: relative;
        z-index: 1;
    }

    .brand-logo {
        max-width: 65%;
        margin-bottom: 0;
        margin-top: -10px;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }

    .right-section {
        width: 100%;
        flex: 0 0 auto;
        padding: 15px 15px;
        padding-top: 10px;
        background: transparent;
        height: auto;
        overflow-y: visible;
        overflow-x: hidden;
    }

    .tabs-container {
        max-width: 100%;
        width: 100%;
    }

    .tabs-header {
        padding: 5px;
        gap: 4px;
        border-radius: 50px;
        overflow-x: auto;
        margin-bottom: 15px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .tab-button {
        padding: 10px 14px;
        font-size: 0.85rem;
        gap: 5px;
        min-height: 42px;
        min-width: fit-content;
    }

    .tab-icon {
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .tab-label {
        font-size: 0.85rem;
    }

    .game-menu {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .game-card {
        flex-direction: column;
        min-height: 200px;
        overflow: visible;
    }

    .sequence-number {
        width: 42px;
        height: 42px;
        font-size: 1.6rem;
        top: -12px;
        left: -12px;
        border-width: 3px;
        font-weight: 900;
    }

    .game-thumbnail {
        height: 110px;
        width: 100%;
        font-size: 3rem;
        border-bottom: none;
    }

    .game-info {
        text-align: center;
        padding: 15px 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 90px;
    }

    .game-title {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .game-description {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 6px;
    }

    .game-age {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .tabs-header {
        padding: 4px;
        gap: 3px;
    }

    .tab-button {
        padding: 8px 12px;
        font-size: 0.75rem;
        gap: 4px;
        min-height: 38px;
    }

    .tab-icon {
        font-size: 1rem;
    }

    .tab-label {
        font-size: 0.75rem;
    }

    .game-menu {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-card {
        min-height: 180px;
    }

    .game-thumbnail {
        height: 100px;
        font-size: 2.5rem;
    }

    .game-info {
        padding: 12px;
        min-height: 80px;
    }

    .game-title {
        font-size: 1rem;
    }

    .game-description {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }

    .game-age {
        font-size: 0.65rem;
    }
}