/* ================= RESET ================= */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f2f2f2;
}

/* ================= HEADER ================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--dark);
    color: var(--header-text);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

header h1 {
    margin: 0;
    font-size: 22px;
}

header h1 a {
    color: var(--header-text);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 18px;
    font-size: 18px;
}

nav a {
    color: var(--header-text);
    text-decoration: none;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.2s ease;
}

nav a:hover::after {
    width: 100%;
}

/* ================= FOOTER ================= */
        footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: var(--footer-height);
            background: var(--dark);
            color: var(--header-text);
            display: flex;
            align-items: center;
            justify-content: right;
            font-size: 14px;
            box-shadow: 0 -2px 6px rgba(0,0,0,0.4);
        }

/* ================= MOBILE MENU ================= */
#hamburger {
    display: none;
    font-size: 30px;
    cursor: pointer;
}

#mobileMenu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--dark-light);
    display: none;
    flex-direction: column;
}

#mobileMenu a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    border-bottom: 1px solid #444;
    font-size: 20px;
}

/* ================= CONTENT ================= */
main {
    padding: 30px 20px;
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ================= COMMON CONTAINERS ================= */
.add-game,
.edit-game,
.game-detail,
.home-container,
.settings-page {
    max-width: 1000px;
    margin: auto;
    background: var(--light);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ================= FLASH MESSAGES ================= */
.flash-success,
.message-success {
    background: var(--success-bg);
    color: var(--success-text);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.message-error,
.flash-error {
    color: var(--danger);
    margin-bottom: 15px;
}

/* ================= HOME (COLLECTION) ================= */
.platform-block {
    margin-bottom: 30px;
}

.platform-title {
    font-size: 1.4em;
    font-weight: bold;
    margin: 20px 0 10px;
}

.game-item {
    background: #f1f1f1;
    padding: 12px 15px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-weight: bold;
    display: block;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.game-item:hover {
    background: #e0e0e0;
}

/* ================= FORMS ================= */
.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.textarea-description {
    min-height: 140px;
    resize: none;
}

/* ================= BUTTONS ================= */
.submit-btn,
button {
    background: var(--dark);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.submit-btn:hover,
button:hover {
    background: #000;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    nav {
        display: none;
    }

    #hamburger {
        display: block;
    }
}

/* ================= EDIT GAME ================= */

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.edit-header h2 {
    margin: 0;
    font-size: 26px;
}

.edit-actions a,
.edit-actions button {
    text-decoration: none;
    font-weight: bold;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    margin-right: 10px;
    padding: 0;
}

.edit-actions a.delete {
    color: var(--danger);
}

/* Sections */
.edit-section {
    margin-bottom: 30px;
}

.edit-section h3 {
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}
.section {
    margin-bottom: 30px;
}

.section h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

/* Images */
.images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.images-preview img {
    max-width: 150px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.screenshot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.screenshot-item img {
    max-width: 120px;
    border-radius: 6px;
}

.screenshot-item a {
    color: var(--danger);
    font-weight: bold;
    text-decoration: none;
}

/* RAWG update menu */
#updateMenu {
    display: none; /* 🔴 indispensable */
    background: #f5f5f5;
    padding: 15px;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Game detail */
.game-detail {
    max-width: 1000px;
    margin: auto;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.game-header h2 {
    margin: 0;
    font-size: 28px;
}

.game-actions a {
    margin-right: 10px;
    text-decoration: none;
    color: #0066cc;
    font-weight: bold;
}

.game-actions a.delete {
    color: #c0392b;
}

.game-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.game-meta p {
    margin: 0;
    background: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
}

.game-description {
    margin-bottom: 25px;
}

.game-description h3 {
    margin-bottom: 5px;
}

.game-tags {
    margin-bottom: 25px;
    color: #ADADAD;
    font-style: italic;
    
}

.game-tags h3 {
    margin-bottom: 5px;
}

.game-images {
    margin-bottom: 25px;
}

.main-image img {
    max-width: 300px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.screenshots img {
    max-width: 200px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Mobile */
@media (max-width: 768px) {
    .game-header h2 {
        font-size: 24px;
    }

    .screenshots img {
        max-width: 100%;
    }
}

/* Page Settings */
.settings-page {
    max-width: 900px;
    margin: auto;
}

.settings-page h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.settings-intro {
    margin-bottom: 25px;
    color: #555;
}

.settings-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.settings-card h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 20px;
}

.settings-card .subtitle {
    font-size: 14px;
    color: #777;
    margin-bottom: 15px;
}

.settings-card label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.settings-card input,
.settings-card select {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.settings-card button {
    padding: 8px 16px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.settings-card button:hover {
    background: #000;
}

.flash-success {
    color: #2e7d32;
    margin-bottom: 15px;
}

.flash-error {
    color: #c0392b;
    margin-bottom: 15px;
}
.page-actions {
    margin-bottom: 20px;
}

.action-link {
    text-decoration: none;
    font-weight: bold;
    color: #0066cc;
    transition: color 0.2s ease;
    margin-right: 10px;
}

.action-link:hover {
    color: #003f7f;
}

/* Recherche */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

.search-form button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

/* Add Game */
.manual-form {
    max-width: 500px;
}

.manual-form .form-group {
    margin-bottom: 15px;
}

.manual-form .form-actions {
    margin-top: 20px;
    text-align: right;
}
/* ================= EDIT GAME – INFOS PERSO ================= */

.personal-flags {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.flag-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #f1f1f1;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

.flag-checkbox input {
    display: none;
}

.flag-checkbox.favorite {
    color: var(--accent);
}

.flag-checkbox.completed {
    color: #2e7d32;
}

.flag-checkbox input:checked + span {
    text-decoration: underline;
}

.flag-checkbox input:checked ~ .checkmark {
    background: currentColor;
}

.flag-checkbox .checkmark {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
}

/* Infos perso layout */
.personal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Note */
.rating-input {
    max-width: 120px;
}

/* Textarea tips */
.tips-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ================= RANDOM GAME ================= */

.random-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.random-card {
    background: var(--light);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.3s ease-in-out;
}

.random-title {
    font-size: 22px;
    font-weight: bold;
    margin: 15px 0 5px;
}

.random-platform {
    color: #555;
    margin-bottom: 20px;
}

.random-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.random-actions button {
    min-width: 140px;
}

