/* codebless-meteo — cbm-meteo.css */

#cbm-widget {
    position: fixed;
    right: 0;
    top: 0;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* ── Onglet latéral — masqué, remplacé par la pastille ── */
#cbm-tab {
    display: none !important;
}

/* ── Panneau — depuis le bas à gauche, au-dessus de la pastille ── */
#cbm-panel {
    position: fixed;
    bottom: -520px;
    left: 16px;
    width: 300px;
    height: 480px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    transition: bottom 0.3s ease;
    z-index: 9999;
    overflow: hidden;
}

/* pastille : bottom 16px + hauteur 44px + marge 12px = 72px */
#cbm-panel:not([hidden]) {
    bottom: 76px;
}


/* ── En-tête ── */
.cbm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.cbm-header-loc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.cbm-header-loc i {
    font-size: 14px;
    color: #6b7280;
}

#cbm-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
}

#cbm-close:hover { color: #374151; background: #f3f4f6; }

/* ── Météo actuelle ── */
.cbm-current {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.cbm-cur-icon {
    font-size: 36px;
    color: #6b7280;
    line-height: 1;
}

.cbm-cur-temp {
    font-size: 30px;
    font-weight: 600;
    color: #111827;
    line-height: 1;
}

.cbm-cur-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

.cbm-cur-meta {
    margin-left: auto;
    text-align: right;
}

.cbm-cur-meta span {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

.cbm-cur-meta strong {
    font-size: 12px;
    color: #374151;
    font-weight: 600;
}

/* ── Onglets prévisions ── */
.cbm-tabs {
    display: flex;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.cbm-tab-btn {
    flex: 1;
    padding: 9px 4px;
    font-size: 12px;
    text-align: center;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #9ca3af;
    cursor: pointer;
    font-family: inherit;
    transition: color .15s, border-color .15s;
}

.cbm-tab-btn.active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    font-weight: 600;
}

/* ── Vues ── */
.cbm-view {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cbm-scroll {
    overflow-x: hidden;
}

/* ── Lignes horaires ── */
.cbm-h-row {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    gap: 9px;
    border-bottom: 1px solid #f9fafb;
}

.cbm-h-row:hover { background: #f9fafb; }

.cbm-h-time {
    font-size: 12px;
    color: #9ca3af;
    width: 48px;
    flex-shrink: 0;
}

.cbm-h-icon {
    font-size: 17px;
    color: #6b7280;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.cbm-h-desc {
    font-size: 12px;
    color: #6b7280;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cbm-h-temp {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.cbm-h-rain {
    font-size: 11px;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* ── Lignes journalières ── */
.cbm-d-row {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    gap: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.cbm-d-row:last-child { border-bottom: none; }
.cbm-d-row:hover { background: #f9fafb; }

.cbm-d-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    width: 72px;
    flex-shrink: 0;
}

.cbm-d-icon {
    font-size: 17px;
    color: #6b7280;
    flex-shrink: 0;
}

.cbm-d-rain {
    font-size: 11px;
    flex: 1;
}

.cbm-d-temps {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.cbm-d-temps strong {
    color: #111827;
    font-weight: 600;
}

/* ── Couleurs pluie ── */
.cbm-rain-ok   { color: #16a34a; }
.cbm-rain-warn { color: #d97706; }
.cbm-rain-bad  { color: #dc2626; }

/* ── Footer ── */
.cbm-footer {
    padding: 7px 14px;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

/* ── Loader ── */
.cbm-loading {
    padding: 16px 14px;
    color: #9ca3af;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes cbm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.cbm-spin {
    animation: cbm-spin 1s linear infinite;
    display: inline-block;
}

/* ── Mobile : pastille fixe en bas à gauche ── */
@media (max-width: 600px) {

    /* Masquer l'onglet latéral */
    #cbm-tab {
        display: none !important;
    }

    /* Pastille météo compacte en bas à gauche */
    #cbm-topbar {
        display: flex !important;
    }

    /* Panneau pleine largeur au-dessus de la pastille */
    #cbm-panel {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
        border-radius: 16px;
        height: 70vh;
        bottom: -70vh;
    }

    #cbm-panel:not([hidden]) {
        bottom: 76px;
    }

    #cbm-tab.open {
        right: 0;
    }
}

#cbm-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}

#cbm-overlay.visible {
    display: block !important;
}

/* ── Pastille météo en bas à gauche (desktop + mobile) ── */
#cbm-topbar {
    display: inline-flex;
    position: fixed;
    bottom: 16px;
    left: 16px;
    height: 44px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    gap: 6px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
    width: auto;
}

#cbm-topbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

#cbm-topbar-temp {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    flex-shrink: 0;
}

#cbm-topbar-label {
    font-size: 12px;
    color: #6b7280;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#cbm-topbar-parc {
    display: none;
}

#cbm-topbar-arrow {
    display: flex;
    align-items: center;
    color: #9ca3af;
    transition: transform 0.2s;
    flex-shrink: 0;
}

#cbm-topbar-arrow.open {
    transform: rotate(180deg);
}

/* ── SVG icônes inline ── */
.cbm-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cbm-cur-icon.cbm-svg svg {
    width: 36px;
    height: 36px;
}

.cbm-h-icon.cbm-svg svg {
    width: 20px;
    height: 20px;
}

.cbm-d-icon.cbm-svg svg {
    width: 20px;
    height: 20px;
}

#cbm-topbar-icon svg {
    width: 22px;
    height: 22px;
}

#cbm-tab-icon svg {
    width: 22px;
    height: 22px;
}
