/* =========================
   DIARY SEARCH BAR
========================= */

.diary-search-container{
    position: relative;

    display: flex;
    align-items: center;

    width: 100%;

    margin-bottom: 2rem;
}

.diary-search-icon{
    position: absolute;

    left: 18px;

    color: #94a3b8;

    pointer-events: none;

    transition: color 0.25s ease;
}

.diary-search-input{
    width: 100%;

    padding:
        1rem
        1.2rem
        1rem
        3.2rem;

    border:
        1px solid #e2e8f0;

    border-radius: 18px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fafbff
        );

    font-size: 0.95rem;
    font-weight: 500;

    color: #0f172a;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.2s ease;

    box-shadow:
        0 4px 14px rgba(15, 23, 42, 0.04);
}

.diary-search-input::placeholder{
    color: #94a3b8;
}

.diary-search-input:hover{
    border-color: #cbd5e1;
}

.diary-search-input:focus{
    outline: none;

    border-color: #63f163;

    box-shadow:
        0 0 0 4px rgba(99, 241, 123, 0.12),
        0 10px 25px rgba(99, 241, 118, 0.1);
}

.diary-search-input:focus
+ .diary-search-icon{
    color: #6366f1;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px){

    .diary-search-input{
        font-size: 0.9rem;

        padding:
            0.9rem
            1rem
            0.9rem
            3rem;
    }

}
/* =========================
   DIARIO - NOTAS RECIENTES
========================= */

.diary-recent-notes{
    display: grid;
    gap: 1rem;
}

.diary-note-card{
    display: grid;
    gap: .8rem;
    padding: 1rem;
    border-radius: 20px;
    background: #f8fbfa;
    border: 1px solid rgba(44, 122, 94, .12);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}

.diary-note-card-top{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.diary-note-card-top h3{
    margin: .25rem 0 0;
    color: var(--text-dark, #183d34);
    font-size: 1.05rem;
    line-height: 1.3;
}

.diary-note-meta{
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    min-width: 0;
}

.diary-note-time{
    color: var(--primary-dark, #1e5a45);
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.diary-note-emoji{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.8rem;
    min-width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
}

.diary-note-title{
    margin: .2rem 0 0;
    color: var(--text-dark, #183d34);
    line-height: 1.45;
}

.diary-note-content{
    margin: 0;
    color: var(--text-body, #334155);
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.diary-share-chip{
    justify-self: start;
}

.diary-entry[hidden],
.diary-book-page[hidden]{
    display: none !important;
}

/* =========================
   DIARIO COMPLETO - LIBRO
========================= */

body.diary-all-page .diary-all-card{
    width: min(1180px, 100%);
    max-width: 1180px;
    margin: 1.25rem auto 0;
}

.diary-book-wrapper{
    overflow: hidden;
}

.diary-book-summary{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: center;
}

.diary-book-filters{
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(260px, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(44, 122, 94, .12);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(224, 242, 233, .65), rgba(255, 255, 255, .92));
}

.diary-book-filter-field{
    margin: 0;
}

.diary-filter-input{
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(44, 122, 94, .16);
    border-radius: 14px;
    padding: .72rem .9rem;
    background: #fff;
    color: var(--text-dark, #183d34);
    font: inherit;
    box-sizing: border-box;
}

.diary-filter-input:focus{
    outline: 3px solid rgba(44, 122, 94, .13);
    border-color: rgba(44, 122, 94, .4);
}

.diary-filter-clear{
    min-height: 44px;
    align-self: end;
}

.diary-book{
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 1.25rem;
    border-radius: 28px;
    background:
        linear-gradient(90deg, rgba(30, 90, 69, .16), rgba(255,255,255,0) 5%, rgba(255,255,255,0) 95%, rgba(30, 90, 69, .16)),
        #eaf4ef;
    box-shadow: inset 0 0 0 1px rgba(44, 122, 94, .12), 0 18px 45px rgba(15, 23, 42, .08);
}

.diary-book::before{
    content: '';
    position: absolute;
    top: 1.25rem;
    bottom: 1.25rem;
    left: 50%;
    width: 2px;
    transform: translateX(-1px);
    background: linear-gradient(180deg, transparent, rgba(30, 90, 69, .35), transparent);
    box-shadow: 0 0 24px rgba(30, 90, 69, .22);
    pointer-events: none;
}

.diary-book-page{
    min-width: 0;
    padding: .75rem;
}

.diary-book-page-inner{
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 520px;
    max-height: 620px;
    padding: 1.35rem 1.25rem;
    border: 1px solid rgba(44, 122, 94, .12);
    background:
        repeating-linear-gradient(#fffdf8 0 38px, #f7efe3 39px 40px),
        #fffdf8;
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, .06);
}

.diary-book-page:nth-child(odd) .diary-book-page-inner{
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.diary-book-page:nth-child(even) .diary-book-page-inner{
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.diary-book-page-header{
    padding-bottom: .85rem;
    margin-bottom: .9rem;
    border-bottom: 1px dashed rgba(44, 122, 94, .22);
}

.diary-book-page-header h3{
    margin: .25rem 0 .25rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
    color: #163f32;
    line-height: 1.25;
}

.diary-book-page-header small{
    color: var(--text-muted, #64748b);
    font-weight: 700;
}

.diary-book-page-scroll{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: .4rem;
}

.diary-day-timeline{
    display: grid;
    gap: 1rem;
    border-left: 3px solid rgba(44, 122, 94, .86);
    padding-left: 1rem;
}

.diary-day-note{
    display: grid;
    gap: .55rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(44, 122, 94, .18);
}

.diary-day-note:last-child{
    border-bottom: 0;
    padding-bottom: 0;
}

.diary-book-page-footer{
    padding-top: .9rem;
    margin-top: .9rem;
    border-top: 1px dashed rgba(44, 122, 94, .18);
}

@media (max-width: 960px){
    .diary-book-filters{
        grid-template-columns: 1fr;
    }

    .diary-filter-clear{
        width: 100%;
    }
}

@media (max-width: 768px){
    .diary-note-card-top{
        flex-direction: column;
        gap: .45rem;
    }

    .diary-book-summary{
        grid-template-columns: 1fr auto;
    }

    .diary-book{
        grid-template-columns: 1fr;
        padding: .75rem;
        gap: 1rem;
        background: #eaf4ef;
    }

    .diary-book::before{
        display: none;
    }

    .diary-book-page{
        padding: 0;
    }

    .diary-book-page-inner{
        min-height: 72vh;
        max-height: 78vh;
        border-radius: 18px !important;
        padding: 1.1rem;
    }

    .diary-book-page-scroll{
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .diary-day-timeline{
        padding-left: .8rem;
    }
}

/* =========================
   DIARIO COMPLETO - AJUSTE LIBRO BLANCO Y PAGINADO
========================= */
body.diary-all-page .dashboard-main{
    overflow-y: auto !important;
    overflow-x: hidden;
    padding-bottom: 5rem;
}

body.diary-all-page .diary-book-wrapper{
    overflow: visible !important;
}

.diary-book-topbar{
    align-items: flex-start;
}

.diary-book-header-actions{
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.diary-book-mini-stats{
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.diary-book-mini-stats span{
    display: inline-flex;
    align-items: baseline;
    gap: .25rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: #f2faf7;
    border: 1px solid rgba(44, 122, 94, .12);
    color: #607a72;
    font-size: .82rem;
    font-weight: 800;
}

.diary-book-mini-stats strong{
    color: var(--primary-dark, #1e5a45);
    font-size: 1rem;
}

.diary-book{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 1.1rem;
    border-radius: 26px;
    background: #ffffff !important;
    border: 1px solid rgba(44, 122, 94, .13);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .07);
    overflow: visible;
}

.diary-book::before{
    top: 1.1rem;
    bottom: 1.1rem;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(30, 90, 69, .20), transparent);
    box-shadow: none;
}

.diary-book-page{
    display: block;
    padding: 0;
}

.diary-book-page[hidden]{
    display: none !important;
}

.diary-book-page-inner{
    min-height: 560px;
    max-height: 70vh;
    padding: 1.45rem;
    background: #ffffff !important;
    border: 1px solid rgba(44, 122, 94, .12);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}

.diary-book-page:nth-child(odd) .diary-book-page-inner{
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top-left-radius: 22px;
    border-bottom-left-radius: 22px;
}

.diary-book-page:nth-child(even) .diary-book-page-inner{
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-top-right-radius: 22px;
    border-bottom-right-radius: 22px;
}

.diary-book-page-scroll{
    scrollbar-width: thin;
    padding-right: .7rem;
}

.diary-book-page-scroll::-webkit-scrollbar{
    width: 8px;
}

.diary-book-page-scroll::-webkit-scrollbar-thumb{
    border-radius: 999px;
    background: rgba(44, 122, 94, .24);
}

.diary-book-nav{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.diary-book-nav[hidden]{
    display: none !important;
}

.diary-page-arrow{
    width: 52px;
    height: 52px;
    border: 1px solid rgba(44, 122, 94, .18);
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-dark, #1e5a45);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.diary-page-arrow:hover:not(:disabled){
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.diary-page-arrow:disabled{
    opacity: .35;
    cursor: not-allowed;
}

@media (max-width: 768px){
    body.diary-all-page .diary-all-card{
        margin-top: .75rem;
    }

    .diary-book-topbar,
    .diary-book-header-actions{
        align-items: stretch;
    }

    .diary-book-header-actions{
        width: 100%;
        justify-content: space-between;
    }

    .diary-book-mini-stats{
        justify-content: flex-start;
    }

    .diary-book{
        grid-template-columns: 1fr !important;
        padding: .75rem;
        background: #ffffff !important;
        gap: 0;
    }

    .diary-book::before{
        display: none;
    }

    .diary-book-page-inner{
        min-height: 68vh;
        max-height: 74vh;
        border-radius: 22px !important;
    }

    .diary-page-arrow{
        width: 48px;
        height: 48px;
        font-size: 1.8rem;
    }
}

.profile-schedule-list{
    display: grid;
    gap: .55rem;
    margin: .75rem 0 1rem;
}

.profile-schedule-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .75rem;
    border-radius: 14px;
    background: #f8fbfa;
    border: 1px solid rgba(44, 122, 94, .12);
    color: var(--text-dark, #183d34);
    font-weight: 800;
}

.profile-schedule-row small{
    color: var(--text-muted, #64748b);
    font-weight: 800;
}
