/* Modern color system and variables for Urban Isotope */
:root {
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --dark-color: #0f172a; /* Slate 900 */
    --light-color: #f8fafc; /* Slate 50 */
    --border-color: #e2e8f0; /* Slate 200 */
    --text-main: #334155; /* Slate 700 */
    --text-light: #64748b; /* Slate 500 */
    --navbar-bg: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    --hero-bg: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --bulma-strong-color: none;
}

/* Global styling overrides */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text-main);
    background-color: var(--light-color) !important;
}

/* Site wrapper for sticky footer */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* Navbar enhancements */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand strong {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.navbar-item {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar.is-dark .navbar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.navbar.is-dark .navbar-item.is-active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.navbar-item .icon-text .icon {
    margin-right: 0.25rem;
}

/* Navbar burger toggle script support */
.navbar-burger {
    color: #fff;
    /* Ensure spans inherit white */
}

.navbar-burger span {
    background-color: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    margin-right: 0.5rem;
    align-self: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: none;
    cursor: pointer;
}

.navbar-burger:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.navbar-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    position: absolute;
    left: calc(50% - 10px);
    transition: transform 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6), opacity 0.3s ease, top 0.3s ease, background-color 0.3s ease !important;
}

.navbar-burger span:nth-child(1) {
    top: calc(50% - 6px);
}

.navbar-burger span:nth-child(2) {
    top: calc(50% - 1px);
}

.navbar-burger span:nth-child(3) {
    top: calc(50% + 4px);
}

.navbar-burger.is-active span:nth-child(1) {
    top: 50% !important;
    transform: translateY(-50%) rotate(45deg) !important;
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0 !important;
}

.navbar-burger.is-active span:nth-child(3) {
    top: 50% !important;
    transform: translateY(-50%) rotate(-45deg) !important;
}

/* Content styling */
.content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content h1,
.content h2,
.content h3 {
    color: var(--dark-color);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.content img {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Search bar design */
.input {
    border-radius: 8px !important;
    border-color: var(--border-color);
    box-shadow: none;
    transition: all 0.2s ease;
}

.input:focus,
.input:active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

/* Tags styling */
.tag {
    font-weight: 500;
    border-radius: 6px !important;
}

.tag.is-link.is-light {
    background-color: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.tag.is-link.is-light:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.tags.is-flex {
    gap: 0.75rem;
}

.back-to-games-button {
    border-radius: 9999px;
    box-shadow: 0 18px 40px rgba(56, 189, 248, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 190px;
}

.back-to-games-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(56, 189, 248, 0.25);
}

/* Footer enhancements */
.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
}

/* Hero sections */
.hero.is-primary {
    background: var(--hero-bg) !important;
}

/* Game cover styling */
.game-cover {
    position: relative;
    aspect-ratio: 13 / 5;
    overflow: hidden;
    border-radius: 18px;
    background-color: #111;
}

.game-cover__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.game-cover__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    padding: 2rem 1.5rem 1.25rem;
    color: #fff;
    font-size: 1.05rem;
    font-style: italic;
    letter-spacing: 0.01em;
}

/* Card enhancements */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-content {
    flex: 1;
    padding: 1.25rem;
}

.card-content .title.is-5 {
    color: var(--dark-color);
    font-weight: 600;
    transition: color 0.2s ease;
}

.card-hover:hover .card-content .title.is-5 {
    color: var(--primary-color);
}

.card-content a {
    text-decoration: none;
}

.card-content a:hover {
    color: var(--primary-hover);
}

.game-item .card-content {
    padding: 1.25rem;
}

.card-footer-item {
    transition: background-color 0.2s ease;
    border-color: var(--border-color);
    font-weight: 500;
}

.card-footer-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
    color: var(--primary-color);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .content {
        font-size: 1rem;
    }
    
    .navbar-brand strong {
        font-size: 1.2rem;
    }
}

/* Animation utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Utility classes */
.has-border-top {
    border-top: 1px solid var(--border-color);
}

/* Game-specific styles */
.game-embed-wrapper {
    position: relative;
    width: 100%;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.game-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.game-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.game-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hero-bg);
}

.game-placeholder {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.game-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.game-item {
    position: relative;
}

.game-item .card-image {
    position: relative;
    overflow: hidden;
}

.game-item .card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.game-item:hover .card-image::after {
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive game frame */
@media screen and (max-width: 768px) {
    .game-frame {
        padding-bottom: 75%; /* More square on mobile */
    }
    
    .game-badge .tag {
        font-size: 0.875rem;
    }
}

/* Game thumbnail card */
.game-thumbnail {
    position: relative;
    overflow: hidden;
}

.game-thumbnail-figure {
    aspect-ratio: 13 / 5;
    position: relative;
    margin: 0;
}

.game-thumbnail figure {
    margin: 0;
}

.game-thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.category-tags {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.category-tags__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.category-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-tags__tag {
    border: 1px solid rgba(99, 102, 241, 0.18);
    background: rgba(99, 102, 241, 0.08);
    color: #3730a3;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.category-tags__tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.14);
}

/* Ensure badge stays on top of thumbnail */
.game-thumbnail .game-badge {
    z-index: 20;
}
