/* ===========================
   MOBILE FIRST RESPONSIVE
   =========================== */

:root { 
    color-scheme: dark; 
}

* { 
    box-sizing: border-box; 
}

body {
    background: #12131A;
    color: #D9D9E8;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #9c7ed2;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ===========================
   HEADER - Mobile First
   =========================== */
header {
    padding: 16px;
    border-bottom: 1px solid #2E2A47;
    background: #1A1830;
    position: sticky;
    top: 0;
    z-index: 20;
}
.header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.header-discord {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}
.discord-text {
    font-size: 14px;
}
.header-discord i {
    font-size: 32px;
}
/* Header Desktop (min 768px) */
@media (min-width: 768px) {
    header {
        padding: 20px;
    }
    .header-content {
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-height: 60px;
    }
    .header-discord {
        position: static;
    }
    .discord-text {
        font-size: 16px;
    }
    .header-discord i {
        font-size: 40px;
    }
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
    padding: 16px;
}
/* Mobile: une seule colonne */
.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
/* Tablet: transition (garde une colonne) */
@media (min-width: 640px) {
    .container {
        padding: 20px;
    }
    .layout {
        gap: 20px;
    }
}
/* Desktop: 2 colonnes (360px + reste) */
@media (min-width: 1024px) {
    .layout {
        grid-template-columns: 360px minmax(0, 1fr);
        align-items: start;
    }
}

/* ===========================
   CARTES / BOÎTES
   =========================== */
.box {
    background: #2A2540;
    border: 1px solid #382E5D;
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    transition: box-shadow 0.3s, background 0.3s;
}
.box + .box {
    margin-top: 16px;
}
@media (min-width: 640px) {
    .box {
        border-radius: 18px;
        padding: 24px 22px;
        box-shadow: 0 6px 18px 0 rgba(0, 0, 0, 0.3);
    }
}

/* ===========================
   TITRES
   =========================== */
h1, h2 {
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-weight: 700;
    color: #D9D9E8;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 24px;
}
h2 {
    font-size: 20px;
}
.subtle {
    color: #B6A6DE;
    font-weight: 500;
    font-size: 16px;
}
.emoji {
    display: inline-block;
    font-size: 1em;
}
.discord-text {
    font-size: 16px;
}
@media (min-width: 640px) {
    h1 {
        font-size: 22px;
    }
    h2 {
        font-size: 20px;
        gap: 12px;
    }
    .subtle {
        font-size: 16px;
    }
}
@media (min-width: 768px) {
    h1 {
        font-size: 24px;
    }
}
/* ======= 1.2x à partir de 1024px ======= */
@media (min-width: 1024px) {
    h1 {
        font-size: 28.8px; /* 24 * 1.2 */
    }
    h2 {
        font-size: 24px;   /* 20 * 1.2 */
    }
    .emoji {
        font-size: 1.2em;
    }
    .discord-text {
        font-size: 19.2px; /* 16 * 1.2 */
    }
    .subtle {
        font-size: 19.2px; /* 16 * 1.2 */
    }
}

/* ===========================
   INPUTS, SELECTS, TEXTAREA
   =========================== */
input, select, button, textarea {
    background: #211D3A;
    border: 1px solid #5B4C9B;
    color: #D9D9E8;
    border-radius: 10px;
    padding: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}
input[type="color"] {
    height: 44px;
    cursor: pointer;
}
input[type="checkbox"] {
    width: auto;
}
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #5646A0;
    border: 1px solid #8B78D9;
    border-radius: 12px;
    padding: 10px 40px 10px 16px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%239c7ed2' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}
select:hover, select:focus {
    background-color: #725adf;
    border-color: #B19BEB;
    outline: none;
    box-shadow: 0 0 6px rgba(177, 155, 235, 0.7);
}
@media (min-width: 640px) {
    select {
        border-radius: 14px;
    }
}

/* ===========================
   LABELS
   =========================== */
label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
    width: 100%;
}
.label-input,
.label-select {
    display: flex;
    gap: 8px;
    align-items: center;
}
.label-full {
    width: 100%;
}

/* ===========================
   ROWS / GRILLES
   =========================== */
.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
/* Sur mobile, tout en colonne simple */
@media (min-width: 640px) {
    .row {
        gap: 8px;
    }
    .row-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .row-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===========================
   BOUTONS
   =========================== */
button {
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    box-shadow: 0 3px 6px rgba(138, 116, 213, 0.4);
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    user-select: none;
    outline-offset: 2px;
}
button:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}
.btn-primary {
    background: linear-gradient(90deg, #9c7ed2, #7e5bef 60%);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(156, 126, 210, 0.3), 0 1px 0 rgba(255, 255, 255, 0.13) inset;
}
.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(90deg, #7e5bef, #9c7ed2 80%);
    box-shadow: 0 4px 16px rgba(156, 126, 210, 0.4);
    outline: none;
}
.btn-ghost {
    background: transparent;
    color: #9c7ed2;
    border: 1px solid #ac9eeb;
    box-shadow: none;
    padding: 10px 20px;
    font-size: 14px;
}
.btn-ghost:hover,
.btn-ghost:focus {
    background-color: rgba(126, 91, 239, 0.15);
    border-color: #7e5bef;
    color: #7e5bef;
    box-shadow: 0 0 8px rgba(126, 91, 239, 0.5);
    outline: none;
}
@media (min-width: 640px) {
    button {
        border-radius: 14px;
        padding: 14px 24px;
        font-size: 18px;
    }
    .btn-ghost {
        padding: 12px 24px;
        font-size: 16px;
    }
}

/* ===========================
   ITEMS (DEVOIRS/PARTIELS)
   =========================== */
.list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
@media (min-width: 640px) {
    .list {
        gap: 14px;
    }
}
.item {
    border: 1px solid #5B4C9B;
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(33, 29, 58, 0.85);
    position: relative;
    transition: box-shadow 0.2s, background-color 0.2s;
}
.item:hover {
    background: rgba(126, 91, 239, 0.09);
    box-shadow: 0 4px 16px rgba(156, 126, 220, 0.27), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
}
@media (min-width: 640px) {
    .item {
        border-radius: 16px;
        padding: 14px 16px;
    }
}
.item-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.item-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #E4E2FF;
}
@media (min-width: 640px) {
    .item-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .item-title {
        font-size: 16px;
        gap: 12px;
    }
}
.badge {
    border-radius: 20px;
    background: #7e5bef;
    color: #fff;
    font-size: 12px;
    padding: 4px 12px;
    font-weight: 600;
    border: none;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: inline-block;
}
@media (min-width: 640px) {
    .badge {
        font-size: 13px;
        padding: 5px 14px;
    }
}
.details {
    color: #CCC7E6;
    margin-top: 8px;
    font-size: 13px;
}
@media (min-width: 640px) {
    .details {
        font-size: 14px;
    }
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.actions a, 
.actions button {
    font-size: 14px;
}
@media (min-width: 640px) {
    .actions {
        gap: 10px;
        margin-top: 0;
    }
    .actions a, 
    .actions button {
        font-size: 15px;
    }
}
.actions-grid-full {
    grid-column: 1 / -1;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(126, 91, 239, 0.2);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}
.pill:hover {
    background: rgba(126, 91, 239, 0.3);
}

/* ===========================
   AUTOCOMPLETE
   =========================== */
.autocomplete-wrap {
    position: relative;
    width: 100%;
}
.autocomplete-items {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    border: 1px solid #5B4C9B;
    z-index: 50;
    background-color: #342E62;
    max-height: 210px;
    overflow-y: auto;
    color: white;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(156, 126, 210, 0.5);
}
.autocomplete-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid #2E2A47;
    font-size: 15px;
    transition: background-color 0.2s ease;
}
.autocomplete-item:last-child {
    border-bottom: 0;
}
.autocomplete-item:hover,
.autocomplete-active {
    background-color: #715ADD;
}

/* ===========================
   ERREURS
   =========================== */
.error {
    color: #fca5a5;
    margin-top: 10px;
    font-weight: 600;
    font-size: 14px;
}

/* ===========================
   HELPER: TEINTE MATIÈRE
   =========================== */
.tinted {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
}
