/* ============================================================
   diary.css — Diario de aprendizaje Octalysis
   White Hat (drives 1-4) vs Black Hat (drives 5-8)
   ============================================================ */

/* ── Botón del diario en el inventario ───────────────────── */
#diary-open-btn {
    display: block;
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    color: #c0b8e8;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
    margin-top: 12px;
    letter-spacing: .5px;
    text-align: center;
    transition: background .2s, border-color .2s;
    pointer-events: all;
}
#diary-open-btn:hover {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.25);
}

/* ── Overlay del diario ──────────────────────────────────── */
#diary-overlay {
    position: fixed;
    inset: 0;
    z-index: 550;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    transition: background .25s ease;
}
#diary-overlay.visible {
    background: rgba(0,0,0,.78);
    pointer-events: all;
}

/* ── Panel principal ─────────────────────────────────────── */
#diary-panel {
    background: #0d0b1e;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* clip border-radius */
    transform: scale(.9) translateY(20px);
    opacity: 0;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
}
#diary-panel.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Header ──────────────────────────────────────────────── */
#diary-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#diary-title {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
#diary-progress {
    font-size: 17px;
    color: rgba(255,255,255,.4);
    font-family: 'Segoe UI', Arial, sans-serif;
}
#diary-close {
    background: none; border: none;
    color: rgba(255,255,255,.35);
    font-size: 17px; cursor: pointer;
    padding: 2px; line-height: 1;
    transition: color .2s;
}
#diary-close:hover { color: rgba(255,255,255,.7); }

/* ── Tabs White Hat / Black Hat ──────────────────────────── */
#diary-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.diary-tab {
    flex: 1;
    padding: 11px 14px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s, background .2s;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.diary-tab.white {
    color: rgba(255,215,0,.45);
}
.diary-tab.white.active {
    color: #FFD700;
    border-bottom-color: #FFD700;
    background: rgba(255,215,0,.05);
}
.diary-tab.black {
    color: rgba(180,0,60,.5);
}
.diary-tab.black.active {
    color: #FF4466;
    border-bottom-color: #FF4466;
    background: rgba(180,0,60,.07);
}

/* ── Cuerpo scrollable ───────────────────────────────────── */
#diary-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#diary-body::-webkit-scrollbar { width: 4px; }
#diary-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* ── Ficha de drive ──────────────────────────────────────── */
.diary-card {
    border-radius: 14px;
    border: 1px solid;
    font-family: 'Segoe UI', Arial, sans-serif;
    cursor: pointer;
    transition: border-color .2s;
}
.diary-card.locked {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}

/* Cabecera de la ficha */
.diary-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    position: relative;
}
.diary-card-emoji { font-size: 26px; flex-shrink: 0; }
.diary-card-name  { font-size: 16px; font-weight: 700; color: #fff; flex: 1; }
.diary-card-hat-badge {
    font-size: 15px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex-shrink: 0;
}
.diary-card-chevron {
    font-size: 17px;
    color: rgba(255,255,255,.3);
    flex-shrink: 0;
    transition: transform .25s;
}
.diary-card.open .diary-card-chevron { transform: rotate(180deg); }

/* Cuerpo expandible de la ficha */
.diary-card-body {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.diary-card.open .diary-card-body { display: block; }

.diary-section {
    margin-top: 12px;
}
.diary-section-label {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}
.diary-section-text {
    font-size: 15px;
    color: #c0b8e8;
    line-height: 1.65;
}

/* Tags de ejemplos reales */
.diary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.diary-tag {
    font-size: 15px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    color: rgba(255,255,255,.6);
}

/* ── Colores White Hat ───────────────────────────────────── */
.diary-card.white {
    border-color: rgba(255,215,0,.2);
    background: linear-gradient(135deg, rgba(255,215,0,.04), transparent);
}
.diary-card.white .diary-card-header { background: rgba(255,215,0,.05); }
.diary-card.white .diary-card-hat-badge {
    background: rgba(255,215,0,.15);
    color: #FFD700;
    border: 1px solid rgba(255,215,0,.3);
}
.diary-card.white .diary-section-label { color: #FFD700; }

/* ── Colores Black Hat ───────────────────────────────────── */
.diary-card.black {
    border-color: rgba(220,20,60,.2);
    background: linear-gradient(135deg, rgba(220,20,60,.04), transparent);
}
.diary-card.black .diary-card-header { background: rgba(220,20,60,.06); }
.diary-card.black .diary-card-hat-badge {
    background: rgba(220,20,60,.15);
    color: #FF4466;
    border: 1px solid rgba(220,20,60,.3);
}
.diary-card.black .diary-section-label { color: #FF4466; }

/* ── Aviso de drive bloqueado ────────────────────────────── */
.diary-locked-hint {
    font-size: 15px;
    color: rgba(255,255,255,.25);
    text-align: center;
    padding: 8px 0 2px;
    font-style: italic;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
    #diary-panel      { border-radius: 14px; }
    #diary-body       { padding: 12px 12px; }
    .diary-card-name  { font-size: 15px; }
}

/* ── Ajuste al design system ─────────────────────────────── */
#diary-panel, .diary-tab, .diary-card { font-family: var(--font, 'Inter', sans-serif); }
