* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #121212;
    color: #ffffff;
}

header {
    background: #000000;
    padding: 22px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #242424;
}

header h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
}

nav a {
    color: #000;
    text-decoration: none;
    margin-left: 12px;
    background: #1db954;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: bold;
}

nav a:hover {
    background: #1ed760;
}

main {
    padding: 32px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #181818;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

th {
    background: #181818;
    color: #b3b3b3;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #282828;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #242424;
    color: #eaeaea;
}

tr:hover {
    background: #282828;
}

td:first-child {
    font-weight: 700;
    color: #ffffff;
}

td form {
    margin: 0;
}

body.light-mode .empty {
    background: #ffffff;
    color: #222;
    border: 1px solid #ddd;
}

.delete-btn {
    width: auto;
    background: #2a2a2a;
    color: #ff6b6b;
    border: 1px solid #3a3a3a;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}

.delete-btn:hover {
    background: #ff4d4d;
    color: #000;
    border-color: #ff4d4d;
}

button {
    font-family: inherit;
}

.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #1db95433, #121212 45%);
}

.login-box,
.record-form {
    background: #181818;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.5);
    width: 360px;
    border: 1px solid #282828;
}

.login-box h1 {
    margin-top: 0;
}

.login-box input,
.record-form input,
.record-form textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 13px;
    background: #242424;
    color: white;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
}

.login-box input:focus,
.record-form input:focus,
.record-form textarea:focus {
    outline: none;
    border-color: #1db954;
    box-shadow: 0 0 0 2px #1db95444;
}

.record-form label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
    color: #b3b3b3;
}

.record-form button,
.login-box button {
    width: 100%;
    background: #1db954;
    color: #000;
    padding: 13px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
}

.record-form button:hover,
.login-box button:hover {
    background: #1ed760;
}

.error {
    color: #ffb3b3;
    background: #3a1111;
    padding: 10px;
    border-radius: 8px;
}

.empty {
    background: #181818;
    padding: 22px;
    border-radius: 12px;
    border: 1px solid #282828;
}

.form-page {
    max-width: 520px;
    margin: auto;
}

/* Dark Mode */
/* BOUTON THEME */
#theme-toggle {
    background: #2a2a2a;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    margin-right: 10px;
}

#theme-toggle:hover {
    background: #3a3a3a;
}

/* LIGHT MODE */
body.light-mode {
    background: #f4f1ec;
    color: #222;
}

body.light-mode header {
    background: #ffffff;
    color: #000;
    border-bottom: 1px solid #ddd;
}

body.light-mode table {
    background: white;
}

body.light-mode th {
    background: #f5f5f5;
    color: #333;
}

body.light-mode td {
    color: #222;
    border-bottom: 1px solid #ddd;
}

body.light-mode tr:hover {
    background: #f0f0f0;
}

body.light-mode .delete-btn {
    background: #ffe5e5;
    color: #b00020;
    border-color: #ffb3b3;
}

body.light-mode .delete-btn:hover {
    background: #ff4d4d;
    color: white;
}

body.light-mode nav a {
    background: #1db954;
    color: #000;
}

body.light-mode .login-box,
body.light-mode .record-form {
    background: white;
    color: black;
}
/* recherche */
.filter-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-form input,
.filter-form select {
    padding: 10px;
    border-radius: 999px;
    border: 1px solid #3a3a3a;
    background: #242424;
    color: white;
}

.filter-form input {
    flex: 1;
}

.filter-form button {
    width: auto;
    background: #1db954;
    color: #000;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

body.light-mode .filter-form input,
body.light-mode .filter-form select {
    background: white;
    color: #222;
    border: 1px solid #ccc;
}
/* edition */
.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-btn {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: #2a2a2a;
    color: #4da6ff;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid #3a3a3a;
}

.edit-btn:hover {
    background: #4da6ff;
    color: #000;
}
/* reset filter */
.reset-btn {
    display: inline-block;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    background: #444;
    color: white;
    font-weight: bold;
}

.reset-btn:hover {
    background: #666;
}

/* light mode */
body.light-mode .reset-btn {
    background: #ddd;
    color: #222;
}

body.light-mode .reset-btn:hover {
    background: #bbb;
}

/* smartphone */
@media (max-width: 768px) {

    main {
        padding: 15px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    nav {
        width: 100%;
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    nav a, #theme-toggle {
        flex: 1;
        text-align: center;
    }

    /* FORMULAIRE */
    .filter-form {
        flex-direction: column;
    }

    .filter-form input,
    .filter-form select,
    .filter-form button,
    .reset-btn {
        width: 100%;
    }

    /* TABLE → version mobile */
    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px;
    }

    /* cacher colonnes moins importantes */
    th:nth-child(4),
    td:nth-child(4), /* année */

    th:nth-child(5),
    td:nth-child(5), /* ajouté par */

    th:nth-child(6),
    td:nth-child(6), /* commentaire */

    th:nth-child(7),
    td:nth-child(7) /* date */
    {
        display: none;
    }

    /* bouton plus gros */
    .delete-btn {
        padding: 10px;
        font-size: 1rem;
    }
}
/* Scroll horizontal propre sur mobile */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

/* évite que le tableau se casse */
table {
    min-width: 700px;
}
