/* =========================
   0. RESET & BASE
   ========================= */
* { box-sizing: border-box; }

body {
    font-family: sans-serif;
    max-width: 400px;
    width: 100vw;
    margin: 0 auto;
    padding: 0 8px 30px 8px;
    background: #f5f5f7;
    min-height: 100vh;
}

/* =========================
   1. HEADER & LOGO
   ========================= */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 10px;
}
.logo {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

/* =========================
   2. TITRES
   ========================= */
h1 {
    font-size: 2em;
    margin: 0;
    letter-spacing: 2px;
    color: #222;
}
h2 {
    text-align: center;
    color: #ff5722;
    font-size: 1.1em;
    margin-bottom: 10px;
    margin-top: 0;
}

/* =========================
   3. CARTES (GÉNÉRAL)
   ========================= */
.card {
    background: white;
    padding: 18px 10px;
    margin: 18px 0;
    border-radius: 7px;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
    max-width: 100%;
}

/* =========================
   4. TOP MANGA & COLLECTION
   ========================= */
.top-manga-card, .collection-card {
    border: 2px solid #222;
    margin: 2px;
}
.compteur-card {
    text-align: center;
    border: 2px solid #222;
    font-weight: bold;
    font-size: 1em;
    margin-bottom: 0;
    margin-top: 0;
    background: #fff;
    border-radius: 7px;
}
.top-manga-card ol, .top-manga-card ul {
    padding-left: 18px;
}
.manga-card {
    display: flex;
    align-items: center;
    margin: 10px 0;
}
.manga-img {
    width: 90px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
    border: 1.5px solid #222;
}
.manga-info {
    margin-left: 0;
    font-size: 1em;
}

/* =========================
   5. COLLECTION (ACCUEIL)
   ========================= */
.collection-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}
.collection-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 32%;
    min-width: 90px;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 8px 2px 10px 2px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.collection-item:hover {
    box-shadow: 0 4px 16px rgba(255,87,34,0.13);
    transform: scale(1.04);
}
.collection-img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 6px;
}
.collection-title {
    font-size: 0.98em;
    text-align: center;
    color: #222;
    margin-top: 2px;
    word-break: break-word;
}

/* =========================
   7. FLASH (SCAN)
   ========================= */
.flash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 18px;
}
.flash-btns {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.flash-btns button {
    flex: 1;
    padding: 10px 18px;
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s, transform 0.2s;
}
.flash-btns button:hover {
    background: #ff784e;
    transform: scale(1.05);
}
#flashStatus {
    font-size: 0.95em;
    color: #888;
    margin: 0;
}

/* =========================
   8. BOUTONS GÉNÉRAUX
   ========================= */
button {
    width: 100%;
    padding: 12px;
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin: 6px 0;
    transition: background 0.2s, transform 0.2s;
}
button:hover {
    background: #ff784e;
    transform: scale(1.03);
}

/* =========================
   9. INDICATEUR DE CONNEXION
   ========================= */
.network-status {
    position: absolute;
    top: 16px;
    right: 16px;
    left: auto;
    z-index: 9999;
    padding: 7px 16px;
    border-radius: 18px;
    font-size: 1em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    background: #fff;
    color: #222;
    border: 2px solid #bbb;
    transition: background 0.2s, color 0.2s, border 0.2s;
    pointer-events: none;
}
.network-status.online {
    background: #e8ffe8;
    color: #388e3c;
    border-color: #388e3c;
}
.network-status.offline {
    background: #fff0f0;
    color: #d32f2f;
    border-color: #d32f2f;
}

/* =========================
   10. LOADER & ANIMATION
   ========================= */
.loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #ff5722;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================
   11. RESPONSIVE MOBILE
   ========================= */
@media (max-width: 600px) {
    body {
        max-width: 100vw;
        padding: 0 4px 20px 4px;
    }
    .card {
        padding: 14px 4px;
        margin: 12px 0;
        max-width: 100%;
    }
    .collection-list {
        flex-direction: column;
        gap: 10px;
    }
    .collection-item {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        align-items: center;
        padding: 7px 5px;
    }
    .collection-img {
        width: 60px;
        height: 85px;
        margin-bottom: 0;
        margin-right: 12px;
    }
    .collection-title {
        font-size: 1em;
        text-align: left;
        margin-top: 0;
    }
} 