/* General Body and Layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #222;
    line-height: 1.6;
    padding-top: 70px;
    box-sizing: border-box;
}

/* Header Styling */
header {
    background: #111;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-height: 50px;
}

header .logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
}

header .logo {
    height: 40px;
    margin-right: 10px;
    vertical-align: middle;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #007bff;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 4px 0;
    transition: 0.4s;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background-color: #007bff;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background-color: #007bff;
}

/* Mobile Navigation */
.mobile-nav {
    display: block; /* keep flex control */
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen on the right */
    width: 70%;
    height: 100%;
    background-color: #333;
    padding-top: 70px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3); /* shadow on left side */
    transition: right 0.3s ease-in-out;
    z-index: 999;
    overflow-y: auto;
}

.mobile-nav.open {
    right: 0; /* Slides in from right */
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav ul li a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #444;
    transition: background-color 0.3s ease;
}

.mobile-nav ul li a:hover {
    background-color: #555;
}

body.mobile-nav-active {
    overflow: hidden;
}

/* Container Layout */
.container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    max-width: 1700px;
    margin: 20px auto;
    gap: 3rem;
    box-sizing: border-box;
}

/* Main Section */
.main {
    flex: 1 1 75%;
    min-width: 0;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Games Page Grid Layout */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.game-category {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.game-category h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #005bb5;
}

.game-category ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.game-category ul li a {
    text-decoration: none;
    font-weight: bold;
    color: #007bff;
}

.game-category .share-buttons {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.game-category .share-buttons button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.game-category .share-buttons button:hover {
    background-color: #005bb5;
}

/* AI Posts Page Styles */
.filter-bar {
    margin-bottom: 1rem;
}

.filter-bar select {
    padding: 6px 10px;
    font-size: 1rem;
}

.date-group {
    margin-bottom: 2rem;
}

.date-header {
    background: #333;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.2rem;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    margin: 0.8rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-header h3 {
    font-size: 1.3rem;
    margin: 0;
    flex: 1;
}

.post-type {
    font-size: 1rem;
    font-weight: bold;
    color: #555;
    margin-top: 0.4rem;
}

.comment {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
    white-space: pre-line;
    margin-top: 0.5rem;
}

.comment.show {
    max-height: 1000px;
    opacity: 1;
}

button.toggle, button.share-btn {
    margin-top: 0.6rem;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #333;
    background: #333;
    color: #fff;
}

button.toggle:hover {
    background: #555;
}

button.share-btn {
    margin-left: 10px;
    font-size: 0.8rem;
    background: #0066cc;
    border-color: #0066cc;
}

button.share-btn:hover {
    background: #004c99;
}

/* New CSS for the Quirky Feedback Form */
.quirky-feedback-form h3 {
    color: #e60073; /* A fun, bright color */
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}
.quirky-feedback-form p {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1rem;
    font-style: italic;
}
.quirky-feedback-form textarea {
    width: 100%;
    padding: 8px;
    margin: 6px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}
.quirky-feedback-form button {
    background: #e60073; /* Match the heading color */
    color: #fff;
    border: none;
    padding: 10px;
    width: 100%;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}
.quirky-feedback-form button:hover {
    background: #b5005b;
}
.quirky-feedback-form .formStatus {
    font-size: 0.9em;
    color: green;
    margin: 6px 0;
    text-align: center;
}

/* Puzzle Container */
#puzzle-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

/* Puzzle Card */
.puzzle-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Emoji Math Problem */
h3.emoji-math-problem {
    font-size: min(4rem, 5vw);
    text-align: center;
    margin: 0.5em 0;
    white-space: nowrap;
    max-width: 100%;
    overflow-x: auto;
}

/* Custom Layout for "Why AI?" page only */
.ai-page-container .main {
    flex: 1 1 80%;
}

.ai-page-container .sidebar {
    flex: 0 0 250px;
}

/* Sidebar */
.sidebar {
    flex: 0 0 320px;
    margin-left: auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: fit-content;
    align-self: flex-start;
    box-sizing: border-box;
}

/* Feedback Styling */
.feedback {
    margin-top: 8px;
    min-height: 1.2em;
    font-weight: bold;
}

/* Hide answers by default */
.answer {
    display: none;
    margin-top: 8px;
    background: #f9f9f9;
    padding: 6px;
    border-radius: 4px;
}

.answer.show {
    display: block;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        max-width: 100%;
    }
    .main, .sidebar {
        max-width: 100%;
    }
    .sidebar {
        margin-left: 0;
    }
}

/* Responsive adjustments for the game grid */
@media (max-width: 650px) {
    .game-grid {
        grid-template-columns: 1fr;
    }
}
