/* =========================================================
   اشعار فارسی
========================================================= */

.poems-page {
    direction: rtl;
    width: 100%;
}

.poems-container {
    width: min(1100px, 94%);
    margin: 30px auto;
}


/* =========================================================
   Search Box
========================================================= */

.poems-search-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 15px rgba(0,0,0,.07);
}


.poems-search-row {
    display: flex;
    gap: 15px;
    align-items: end;
}


.poems-input-wrapper {
    flex: 1;
}


.poems-poet-wrapper {
    width: 300px;
}


.poems-search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #222;
}


.poems-keyword,
#poems-poet {
    width: 100%;
    height: 46px;
    border: 1px solid #bbb;
    border-radius: 8px;
    padding: 0 13px;
    box-sizing: border-box;
    background: #fff;
    color: #222;
    font-size: 15px;
}


.poems-keyword {
    direction: rtl;
    text-align: right;
}


#poems-poet {
    cursor: pointer;
}


/* =========================================================
   Search Mode
========================================================= */

.poems-search-mode {
    display: flex;
    gap: 25px;
    margin-top: 15px;
}


.poems-search-mode label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}


/* =========================================================
   Buttons
========================================================= */

.poems-buttons {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}


.poems-btn {
    border: 1px solid #bbb;
    background: #e8e8e8;
    color: #111;
    border-radius: 7px;
    min-height: 40px;
    padding: 8px 15px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: .2s;
}


.poems-btn:hover {
    background: #dcdcdc;
}


.poems-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* =========================================================
   Results
========================================================= */

.poems-results {
    margin-top: 20px;
}


.poems-results-header {
    background: #1976d2;
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}


.poems-no-results {
    background: #d32f2f;
    color: #fff;
    padding: 16px;
    border-radius: 9px;
    text-align: center;
    font-weight: 700;
}


/* =========================================================
   Poet Group
========================================================= */

.poet-group {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 9px;
    overflow: hidden;
}


.poet-group-header {
    display: flex;
    align-items: center;
    background: #3c9b54;
    min-height: 52px;
}


.poet-toggle {
    flex: 1;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: right;
    padding: 14px 17px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}


.poet-actions {
    display: flex;
    gap: 7px;
    padding: 6px 8px;
}


.poet-actions .poems-btn {
    min-height: 35px;
    padding: 5px 10px;
}


.poet-group-content {
    background: #fafafa;
    padding: 12px;
}


/* =========================================================
   Poem Card
========================================================= */

.poem-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 13px;
}


.poem-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 13px;
}


.poem-tools button {
    background: #e8e8e8;
    color: #111;
    border: 1px solid #bbb;
    border-radius: 6px;
    min-width: 42px;
    min-height: 32px;
    cursor: pointer;
    font-family: inherit;
}


.poem-highlight-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    margin-right: auto;
    margin-bottom: 0 !important;
    font-size: 13px;
    font-weight: 400 !important;
    cursor: pointer;
}


.poem-text {
    direction: rtl;
    text-align: center;
    line-height: 2.2;
    white-space: pre-wrap;
}


.poem-text br {
    line-height: 2.25;
}


.poem-highlight {
    background: #ffeb3b;
    color: #111;
    padding: 0 2px;
    border-radius: 2px;
}


.highlight-disabled .poem-highlight {
    background: transparent;
    color: inherit;
    padding: 0;
}


/* =========================================================
   Biography
========================================================= */

.poet-biography-card {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 9px;
    padding: 16px;
    margin-top: 12px;
}


.poet-biography-card h3 {
    margin-top: 0;
}


/* =========================================================
   All Poems Header
========================================================= */

.poet-all-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}


.poet-all-header strong {
    font-size: 18px;
}


.poet-all-header span {
    margin-right: auto;
}


/* =========================================================
   Loading
========================================================= */

.poems-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 25px;
    direction: rtl;
    font-size: 17px;
    font-weight: 600;
}

.loading-dots {
    display: inline-flex;
}

.loading-dots i {
    font-style: normal;
    opacity: 0;
    animation: poemsLoadingDots 1.4s infinite;
}

.loading-dots i:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots i:nth-child(2) {
    animation-delay: .2s;
}

.loading-dots i:nth-child(3) {
    animation-delay: .4s;
}

@keyframes poemsLoadingDots {

    0% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    60%,
    100% {
        opacity: 0;
    }

}



.poet-search-wrapper {
    position: relative;
    width: 100%;
}

.poet-search-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    color: #222;
    font-size: 16px;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.poet-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,.12);
    z-index: 9999;
}

.poet-dropdown.is-open {
    display: block;
}

.poet-option {
    padding: 10px 14px;
    cursor: pointer;
    direction: rtl;
    text-align: right;
}

.poet-option:hover {
    background: #f0f0f0;
}

.poet-all-option {
    font-weight: 700;
    border-bottom: 1px solid #ddd;
}


.load-more-poems {
    display: block;
    margin: 20px auto;
    background: #eeeeee;
    color: #000000;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 9px 22px;
    cursor: pointer;
}


/* =========================================================
   Mobile
========================================================= */

@media (max-width: 700px) {

    .poems-container {
        width: 94%;
        margin: 18px auto;
    }


    .poems-search-box {
        padding: 15px;
    }


    .poems-search-row {
        display: block;
    }


    .poems-input-wrapper,
    .poems-poet-wrapper {
        width: 100%;
        margin-bottom: 13px;
    }


    .poems-keyword,
    #poems-poet {
        height: 48px;
    }


    .poems-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }


    .poems-btn {
        width: 100%;
    }


    .poet-group-header {
        display: block;
    }


    .poet-toggle {
        width: 100%;
        text-align: right;
    }


    .poet-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 0 8px 8px;
    }


    .poem-text {
        font-size: 17px;
        line-height: 2.2;
    }


    .poem-highlight-toggle {
        margin-right: 0 !important;
        width: 100%;
    }


    .poet-all-header {
        display: block;
    }


    .poet-all-header span {
        display: block;
        margin: 8px 0;
    }
}