/* ==========================================================
   TypingTutor.Online
   Readable Lesson Tips v17.0.19
   File: css/readable-lesson-tips.css
========================================================== */

/*
 * The earlier compact row layout allowed broad inherited styles and limited
 * widths to compress or truncate Goal, Tip, Mistake, and Practice text.
 *
 * This final stylesheet loads last and gives every tip its own readable row.
 */

.typing-practice-card
#lessonTipsPanel.lesson-tips-panel {
    position: absolute !important;
    z-index: 500 !important;

    top: calc(100% - 4px) !important;
    right: 14px !important;
    left: auto !important;

    display: block;

    width: min(560px, calc(100vw - 44px)) !important;
    min-width: 0 !important;
    max-width: 560px !important;
    max-height: min(620px, 72vh) !important;

    margin: 0 !important;
    padding: 18px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    color: #243249 !important;
    background: #ffffff !important;

    border: 1px solid #d8e2ef !important;
    border-radius: 18px !important;

    box-shadow:
        0 24px 70px
        rgba(15, 23, 42, .22) !important;

    white-space: normal !important;
    text-align: left !important;
}

.typing-practice-card
#lessonTipsPanel.lesson-tips-panel[hidden] {
    display: none !important;
}

.lesson-tips-header {
    display: block !important;
    margin: 0 0 14px !important;
    padding: 0 0 13px !important;

    border: 0 !important;
    border-bottom: 1px solid #e2e9f2 !important;
}

.lesson-tips-header > div {
    display: flex !important;
    gap: 11px !important;
    align-items: flex-start !important;
}

.lesson-tips-header-icon {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;

    width: 40px !important;
    height: 40px !important;

    background: #eef5ff !important;
    border-radius: 11px !important;

    font-size: 1.1rem !important;
}

.lesson-tips-header h3 {
    margin: 0 !important;

    color: #172237 !important;

    font-size: 1.05rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;

    white-space: normal !important;
}

.lesson-tips-header p {
    display: block !important;

    margin: 3px 0 0 !important;
    padding: 0 !important;

    color: #68768c !important;

    font-size: .8rem !important;
    line-height: 1.45 !important;

    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.lesson-tips-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;

    width: 100% !important;
    min-width: 0 !important;
}

.lesson-tip-item {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 11px !important;
    align-items: flex-start !important;

    width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 12px 13px !important;

    background: #f8fafc !important;

    border: 1px solid #e1e8f1 !important;
    border-radius: 13px !important;

    white-space: normal !important;
    overflow: visible !important;
}

.lesson-tip-icon {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;

    width: 38px !important;
    height: 38px !important;

    background: #ffffff !important;
    border: 1px solid #e0e8f2 !important;
    border-radius: 10px !important;

    font-size: 1rem !important;
    line-height: 1 !important;
}

.lesson-tip-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 4px !important;

    min-width: 0 !important;
    width: 100% !important;
}

.lesson-tip-content strong {
    display: block !important;

    margin: 0 !important;

    color: #18253b !important;

    font-size: .82rem !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;

    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.lesson-tip-content > span {
    display: block !important;

    min-width: 0 !important;
    width: 100% !important;

    color: #526178 !important;

    font-size: .88rem !important;
    font-weight: 500 !important;
    line-height: 1.55 !important;

    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-overflow: clip !important;
}

.lesson-tip-goal {
    border-left: 4px solid #4d8df7 !important;
}

.lesson-tip-guidance {
    border-left: 4px solid #e4af22 !important;
}

.lesson-tip-mistake {
    border-left: 4px solid #ee875c !important;
}

.lesson-tip-practice {
    border-left: 4px solid #48a878 !important;
}

/* Dark theme */
html[data-theme="dark"]
.typing-practice-card
#lessonTipsPanel.lesson-tips-panel {
    color: #e8eef8 !important;
    background: #111a2b !important;

    border-color: #2b3d57 !important;

    box-shadow:
        0 28px 80px
        rgba(0, 0, 0, .48) !important;
}

html[data-theme="dark"]
.lesson-tips-header {
    border-bottom-color: #2b3c55 !important;
}

html[data-theme="dark"]
.lesson-tips-header-icon {
    background: #192b47 !important;
}

html[data-theme="dark"]
.lesson-tips-header h3,
html[data-theme="dark"]
.lesson-tip-content strong {
    color: #f0f5ff !important;
}

html[data-theme="dark"]
.lesson-tips-header p,
html[data-theme="dark"]
.lesson-tip-content > span {
    color: #b7c4d7 !important;
}

html[data-theme="dark"]
.lesson-tip-item {
    background: #162238 !important;
    border-color: #2c405b !important;
}

html[data-theme="dark"]
.lesson-tip-icon {
    background: #111c30 !important;
    border-color: #30455f !important;
}

/* System dark theme */
@media (prefers-color-scheme: dark) {
    html[data-theme="system"]
    .typing-practice-card
    #lessonTipsPanel.lesson-tips-panel {
        color: #e8eef8 !important;
        background: #111a2b !important;
        border-color: #2b3d57 !important;
    }

    html[data-theme="system"]
    .lesson-tips-header {
        border-bottom-color: #2b3c55 !important;
    }

    html[data-theme="system"]
    .lesson-tips-header-icon {
        background: #192b47 !important;
    }

    html[data-theme="system"]
    .lesson-tips-header h3,
    html[data-theme="system"]
    .lesson-tip-content strong {
        color: #f0f5ff !important;
    }

    html[data-theme="system"]
    .lesson-tips-header p,
    html[data-theme="system"]
    .lesson-tip-content > span {
        color: #b7c4d7 !important;
    }

    html[data-theme="system"]
    .lesson-tip-item {
        background: #162238 !important;
        border-color: #2c405b !important;
    }

    html[data-theme="system"]
    .lesson-tip-icon {
        background: #111c30 !important;
        border-color: #30455f !important;
    }
}

@media (max-width: 760px) {
    .typing-practice-card
    #lessonTipsPanel.lesson-tips-panel {
        position: fixed !important;

        top: auto !important;
        right: 10px !important;
        bottom: 10px !important;
        left: 10px !important;

        width: auto !important;
        max-width: none !important;
        max-height: min(78vh, 620px) !important;

        padding: 15px !important;

        border-radius: 18px !important;
    }

    .lesson-tip-item {
        grid-template-columns: 36px minmax(0, 1fr) !important;
        gap: 9px !important;
        padding: 11px !important;
    }

    .lesson-tip-icon {
        width: 34px !important;
        height: 34px !important;
    }

    .lesson-tip-content > span {
        font-size: .84rem !important;
    }
}
