:root {
    /* Light mode colors */
    --bg-color: #ffffff;
    --text-color: #000000;
    --toggle-bg: #f0f0f0;
    --toggle-hover: #e0e0e0;
    --button-border: #000000;
    --button-text: #000000;
    --button-hover-bg: #ffffff;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-color: #000000;
    --text-color: #ffffff;
    --toggle-bg: #2a2a2a;
    --toggle-hover: #3a3a3a;
    --button-border: #ffffff;
    --button-text: #ffffff;
    --button-hover-bg: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

#bg3d {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

header {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem;
    z-index: 1000;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 1.0rem;
}

.header-btn {
    background-color: transparent;
    border: 1px solid var(--button-border);
    border-radius: 1.0rem;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--button-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    width: 110px;
    text-align: center;
}

.header-btn:hover {
    background-color: var(--button-hover-bg);
}

.header-btn:active {
    outline: none;
}

.header-btn:focus {
    outline: none;
}

#theme-toggle {
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: 0;
}

main {
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.homepage-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 1;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
    color: var(--text-color);
}


.explore-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.explore-overlay.hidden {
    display: none;
}

.explore-box {
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    background-color: var(--bg-color);
    border: 1px solid var(--text-color);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 0.75rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.explore-box::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.card {
    background-color: var(--bg-color);
    border: 1px solid var(--text-color);
    border-radius: 0.75rem;
    padding: 0.75rem 0.75rem 0 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 auto;
    width: calc(50% - 0.75rem);
    min-width: 200px;
    max-width: 250px;
    height: 150px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card[data-available="false"] {
    opacity: 0.5;
    filter: brightness(0.6);
}

.card[data-available="false"] .card-btn {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

.card[data-available="false"]:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.card-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.75rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.card-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.card-buttons {
    display: flex;
    gap: 0;
    width: calc(100% + 1.5rem);
    margin-top: auto;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.card-btn {
    flex: 1;
    background-color: transparent;
    border: none;
    border-top: 1px solid var(--button-border);
    border-radius: 0;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--button-text);
    transition: background-color 0.2s ease;
}

.card-btn:first-child:not(:last-child) {
    border-right: 1px solid var(--button-border);
    border-bottom-left-radius: 0.75rem;
}

.card-btn:last-child:not(:first-child) {
    border-bottom-right-radius: 0.75rem;
}

.card-btn:only-child {
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.card-btn:hover {
    background-color: var(--toggle-hover);
}

.card-btn:active {
    background-color: var(--toggle-bg);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    header {
        padding: 0.75rem;
    }

    #theme-toggle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
    }

    #theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.125rem;
    }
}
