/*
========================================
Main Stylesheet
Imports other stylesheets and contains shared styles.
========================================
*/

@import url('variables.css');
@import url('layout.css');
@import url('components.css');

/*
========================================
Base & Typography
========================================
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.2s, color 0.2s;
    line-height: 1.6;
}

h2 {
    font-size: 2rem; /* Increased font size for h2 */
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem; /* Set font size for h3 */
    font-weight: 600;
    margin-bottom: 1rem;
}

h4, h5, h6 {
    font-weight: 600;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.content-container {
    max-width: 1200px; /* Increased max-width for better layout */
    margin: 0 auto;
    padding: 0 2rem; /* Added horizontal padding */
}

.content-container > h2 {
    margin-bottom: 1.5rem;
}

/*
========================================
Shared List Page Styles (Tools & Games)
========================================
*/

.item-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Tag Search --- */
.tag-search-container {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 1rem;
    background-color: var(--background-secondary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

#search-input {
    margin-bottom: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list.collapsed {
    max-height: 2.5rem; /* Adjust based on tag button height */
    overflow: hidden;
}

.expand-tags-btn:hover {
    background-color: var(--border-color);
}

#expand-tags-btn {
    margin-top: 0.5rem;
    padding: 0.5rem;
}

.card-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

.card-tags .tag {
    background-color: var(--input-bg);
    color: var(--text-secondary-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

.card-tags .tag:hover {
    background-color: var(--border-color);
}

/*
========================================
Shared Game UI System
========================================
*/

.game-status {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    height: 2rem; /* Keep space consistent */
}

.game-container {
    position: relative;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(var(--grid-size, 4), 1fr);
    gap: 10px;
    background-color: var(--border-color);
    padding: 10px;
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: var(--box-shadow);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.game-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--game-overlay-bg);
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 0.3s;
    border-radius: var(--border-radius); /* Match board radius */
}
body.dark-mode .game-overlay { background-color: var(--game-overlay-bg-dark); }

.game-overlay.visible {
    display: flex;
}

.game-overlay-message {
    font-size: 3rem;
    font-weight: bold;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-overlay .button {
    margin-top: 1.5rem;
}

/* --- Animations --- */
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {

    0% { transform: scale(1); }

    50% { transform: scale(1.2); }

    100% { transform: scale(1); }

}


