/* ── OldBook Lyrics Plugin Styles ─────────────────────────────────────────
   Colors and fonts are pulled directly from Elementor's global theme
   variables (--e-global-color-*, --e-global-typography-*) so they stay
   in sync with whatever the site owner sets in Elementor → Global Styles.
   Hard-coded values are fallbacks only.
──────────────────────────────────────────────────────────────────────────── */

:root {
    /* Button / active color — tracks Elementor accent (currently #61CE70) */
    --obl-green:      var(--e-global-color-accent,    #61CE70);
    --obl-green-d:    #4fb560;         /* hover; no Elementor variable for this */
    --obl-green-l:    #f0fdf4;

    /* Gold — site header colour, used for card top-border accent */
    --obl-gold:       #FAC409;
    --obl-gold-d:     #d4a600;
    --obl-gold-l:     #fffbeb;

    /* Focus / link colour — tracks Elementor primary (currently #6EC1E4) */
    --obl-blue:       var(--e-global-color-primary,   #6EC1E4);
    --obl-blue-d:     #54aed4;
    --obl-blue-l:     #eef7fc;

    --obl-bg:         #f4f4f4;
    --obl-card:       #ffffff;
    --obl-border:     #e2e2e2;

    /* Text colours — track Elementor secondary / text */
    --obl-text:       var(--e-global-color-secondary, #54595F);
    --obl-muted:      var(--e-global-color-text,      #7A7A7A);

    --obl-radius:     8px;
    --obl-shadow:     0 4px 20px rgba(0,0,0,.08);

    /* Fonts — track Elementor typography tokens */
    --obl-font:       var(--e-global-typography-text-font-family,      'Roboto'), -apple-system, BlinkMacSystemFont, sans-serif;
    --obl-font-head:  var(--e-global-typography-secondary-font-family, 'Roboto Slab'), Georgia, serif;
    --obl-font-urdu:  'Noto Nastaliq Urdu', serif;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */

.obl-card {
    background: var(--obl-card);
    border-radius: var(--obl-radius);
    box-shadow: var(--obl-shadow);
    border: 1px solid var(--obl-border);
    border-top: 3px solid var(--obl-gold);
    padding: 36px 40px;
    max-width: 680px;
    margin: 32px auto;
    font-family: var(--obl-font);
    direction: ltr;
    text-align: left;
    color: var(--obl-text);
}

.obl-submit-card,
.obl-dashboard-card { max-width: 820px; }

/* ── Form header ──────────────────────────────────────────────────────────── */

.obl-form-header { margin-bottom: 28px; }
.obl-form-header h2 {
    font-family: var(--obl-font-head);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--obl-text);
    margin: 0 0 6px;
    letter-spacing: -.3px;
}
.obl-form-header p { color: var(--obl-muted); margin: 0; font-size: 0.93rem; }

/* ── Alerts ───────────────────────────────────────────────────────────────── */

.obl-alert {
    padding: 13px 16px;
    border-radius: var(--obl-radius);
    margin-bottom: 22px;
    font-size: 0.93rem;
    line-height: 1.65;
}
.obl-alert-error   { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.obl-alert-success { background: var(--obl-green-l); border: 1px solid #86efac; color: #14532d; }
.obl-alert-info    { background: var(--obl-blue-l); border: 1px solid #93c5fd; color: #1e3a5f; }

/* ── Form fields ──────────────────────────────────────────────────────────── */

.obl-form { display: flex; flex-direction: column; gap: 20px; }

.obl-field { display: flex; flex-direction: column; gap: 6px; }

.obl-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--obl-text);
    letter-spacing: .01em;
}

.obl-field input[type="text"],
.obl-field input[type="email"],
.obl-field input[type="password"],
.obl-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--obl-border);
    border-radius: var(--obl-radius);
    font-size: 0.97rem;
    font-family: var(--obl-font);
    color: var(--obl-text);
    background: #fdfcfa;
    box-sizing: border-box;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.obl-field input:focus,
.obl-field select:focus {
    border-color: var(--obl-blue);
    box-shadow: 0 0 0 3px rgba(110,193,228,.18);
    background: #fff;
}

/* Custom select arrow */
.obl-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A7A7A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Urdu-specific inputs */
.obl-urdu-field,
input.obl-urdu-field,
textarea.obl-urdu-field {
    direction: rtl;
    text-align: right;
    font-family: var(--obl-font-urdu);
    font-size: 1.05rem;
    line-height: 2;
}

.obl-field-hint { font-size: 0.78rem; color: var(--obl-muted); }
.obl-req { color: #dc2626; }

/* Two columns */
.obl-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Row field (checkbox + forgot) */
.obl-field-row { flex-direction: row; align-items: center; justify-content: space-between; }
.obl-checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; }
.obl-forgot { font-size: 0.85rem; color: var(--obl-blue); text-decoration: none; }
.obl-forgot:hover { text-decoration: underline; color: var(--obl-blue-d); }

/* Password wrap — eye toggle on the right */
.obl-password-wrap { position: relative; }
.obl-password-wrap input { padding-right: 44px; }
.obl-pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0;
    color: var(--obl-muted); line-height: 1;
}
.obl-pw-toggle:hover { color: var(--obl-blue); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.obl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 22px;
    border-radius: var(--obl-radius);
    font-family: var(--obl-font);
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: all .18s;
    letter-spacing: .01em;
}
/* Specificity 0,1,1 — beats Hello Elementor reset.css [type=submit]/button rules (0,1,0) */
button.obl-btn-primary,
a.obl-btn-primary,
.obl-btn.obl-btn-primary  { background: var(--obl-green); color: #fff; border-color: var(--obl-green); border-width: 1.5px; }
button.obl-btn-primary:hover,
a.obl-btn-primary:hover,
.obl-btn.obl-btn-primary:hover  { background: var(--obl-green-d); border-color: var(--obl-green-d); color: #fff; }

button.obl-btn-secondary,
a.obl-btn-secondary,
.obl-btn.obl-btn-secondary { background: var(--obl-blue); color: #fff; border-color: var(--obl-blue); border-width: 1.5px; }
button.obl-btn-secondary:hover,
a.obl-btn-secondary:hover,
.obl-btn.obl-btn-secondary:hover { background: var(--obl-blue-d); border-color: var(--obl-blue-d); color: #fff; }

button.obl-btn-outline,
a.obl-btn-outline,
.obl-btn.obl-btn-outline  { background: transparent; border-color: var(--obl-border); color: var(--obl-text); border-width: 1.5px; }
button.obl-btn-outline:hover,
a.obl-btn-outline:hover,
.obl-btn.obl-btn-outline:hover  { border-color: var(--obl-blue); color: var(--obl-blue); background: var(--obl-blue-l); }
.obl-btn-full     { width: 100%; }
.obl-btn-sm       { padding: 5px 13px; font-size: 0.8rem; }
.obl-btn-row      { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.obl-link-btn {
    background: none; border: none; cursor: pointer; font-family: var(--obl-font);
    color: var(--obl-muted); font-size: 0.82rem; padding: 0;
    transition: color .15s;
}
.obl-link-btn:hover { color: #dc2626; }

/* Form footer */
.obl-form-footer { text-align: center; font-size: 0.87rem; color: var(--obl-muted); margin-top: 6px; }
.obl-form-footer a { color: var(--obl-blue); text-decoration: none; font-weight: 600; }
.obl-form-footer a:hover { text-decoration: underline; color: var(--obl-blue-d); }

/* Logged-in welcome */
.obl-welcome { font-size: 1.08rem; margin-bottom: 4px; }

/* ── Urdu lyrics editor ───────────────────────────────────────────────────── */

.obl-editor-field { gap: 0; }

.obl-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--obl-bg);
    border: 1.5px solid var(--obl-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}
.obl-editor-label { font-size: 0.875rem; font-weight: 600; color: var(--obl-text); }
.obl-toolbar-right { display: flex; align-items: center; gap: 12px; }
.obl-char-count { font-size: 0.78rem; color: var(--obl-muted); }

.obl-kb-toggle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: #fff;
    border: 1.5px solid var(--obl-border);
    border-radius: 6px;
    font-family: var(--obl-font);
    font-size: 0.8rem;
    color: var(--obl-text);
    cursor: pointer;
    transition: all .18s;
}
.obl-kb-toggle-btn:hover,
.obl-kb-toggle-active { border-color: var(--obl-blue); color: var(--obl-blue); background: var(--obl-blue-l); }

.obl-lyrics-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 20px;
    border: 1.5px solid var(--obl-border);
    border-top: none;
    border-radius: 0;
    font-family: var(--obl-font-urdu);
    font-size: 1.3rem;
    line-height: 2.6;
    color: var(--obl-text);
    background: #fdfcfa;
    resize: none;
    min-height: 220px;
    overflow-y: hidden;
    outline: none;
    direction: rtl;
    text-align: right;
    transition: border-color .18s, box-shadow .18s;
}
.obl-lyrics-textarea:focus {
    border-color: var(--obl-blue);
    box-shadow: 0 0 0 3px rgba(110,193,228,.12);
    background: #fff;
}

.obl-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--obl-bg);
    border: 1.5px solid var(--obl-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 20px;
}
.obl-typing-hint { font-size: 0.76rem; color: var(--obl-muted); }

/* ── On-screen keyboard ───────────────────────────────────────────────────── */

.obl-keyboard-wrap {
    background: #1e1e2e;
    border: 1.5px solid #2d2d44;
    border-top: none;
    border-bottom: none;
    padding: 14px 12px;
    user-select: none;
}

.obl-kb-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 5px;
}

.obl-key {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 52px;
    background: #2d2d44;
    border: 1px solid #3d3d5a;
    border-bottom: 3px solid #1a1a2a;
    border-radius: 6px;
    cursor: pointer;
    padding: 4px 2px;
    box-sizing: border-box;
    transition: background .1s, transform .08s, box-shadow .1s;
    font-family: var(--obl-font-urdu);
    text-align: center;
}
.obl-key:hover { background: #3a3a58; border-color: var(--obl-gold); }
.obl-key:active,
.obl-key-pressed {
    background: var(--e-global-color-accent, #61CE70) !important;
    border-color: var(--obl-green-d, #4fb560) !important;
    transform: translateY(2px);
    box-shadow: 0 0 8px rgba(97,206,112,.4);
}

.obl-key-rom {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 9px;
    color: #666;
    font-family: monospace;
    font-style: normal;
    line-height: 1;
}

.obl-key-shift {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--obl-gold);
    line-height: 1;
    opacity: 0;
    transition: opacity .15s;
}

.obl-key-main {
    font-size: 1.25rem;
    color: #e8d5a3;
    line-height: 1;
    margin-top: 6px;
}

.obl-shift-active .obl-key-shift { opacity: 1; }
.obl-shift-active .obl-key-main  { opacity: .4; }

.obl-key-shift-btn { width: 70px; }
.obl-key-shift-btn .obl-key-rom {
    font-size: 8px; bottom: 4px; top: auto; left: 50%; transform: translateX(-50%);
}
.obl-key-shift-btn .obl-key-main { font-size: 1.1rem; font-family: sans-serif; margin-top: 2px; }
.obl-key-active { background: var(--obl-gold) !important; border-color: var(--obl-gold-d) !important; }
.obl-key-active .obl-key-main { color: #fff; }

.obl-kb-space-row { margin-bottom: 0; }
.obl-key-space { width: 200px; }
.obl-key-space .obl-key-main { font-size: 0.9rem; margin-top: 2px; font-family: sans-serif; }
.obl-key-bs    { width: 60px; }
.obl-key-bs .obl-key-main { font-size: 1.1rem; font-family: sans-serif; }
.obl-key-enter { width: 70px; }
.obl-key-enter .obl-key-main { font-size: 1.2rem; font-family: sans-serif; }

/* ── Dashboard (legacy shortcode) ────────────────────────────────────────── */

.obl-dashboard-header {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 16px;
    margin-bottom: 24px;
}
.obl-dashboard-title {
    font-family: var(--obl-font-head);
    font-size: 1.55rem; font-weight: 700; color: var(--obl-text); margin: 0 0 4px;
}
.obl-dashboard-sub   { color: var(--obl-muted); margin: 0; font-size: 0.9rem; }
.obl-dashboard-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.obl-stats-row {
    display: flex; gap: 1px;
    background: var(--obl-border);
    border: 1px solid var(--obl-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 28px;
}
.obl-stat {
    flex: 1; text-align: center;
    padding: 18px 12px;
    background: var(--obl-bg);
}
.obl-stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--obl-green); line-height: 1; }
.obl-stat-lbl { display: block; font-size: 0.78rem; color: var(--obl-muted); margin-top: 5px; letter-spacing: .02em; text-transform: uppercase; }

.obl-section-title {
    font-size: 0.8rem; font-weight: 700;
    color: var(--obl-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--obl-border);
    padding-bottom: 10px;
    margin: 0 0 14px;
}

.obl-posts-list { display: flex; flex-direction: column; gap: 8px; }

.obl-post-item {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
    padding: 13px 16px;
    background: #fdfcfa;
    border: 1px solid var(--obl-border);
    border-radius: 8px;
    transition: border-color .18s, box-shadow .18s;
}
.obl-post-item:hover { border-color: var(--obl-blue); box-shadow: 0 2px 8px rgba(110,193,228,.1); }

.obl-post-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.obl-post-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.obl-post-title {
    font-size: 0.97rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 280px;
}
.obl-post-cat {
    font-size: 0.75rem; color: var(--obl-blue);
    background: var(--obl-blue-l); border: 1px solid #93c5fd;
    padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.obl-post-date { font-size: 0.76rem; color: var(--obl-muted); white-space: nowrap; }

.obl-badge {
    font-size: 0.73rem; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    white-space: nowrap; letter-spacing: .02em;
}
.obl-badge-published { background: var(--obl-green-l); color: #14532d; border: 1px solid #86efac; }
.obl-badge-pending   { background: var(--obl-gold-l); color: #78350f; border: 1px solid #fcd34d; }
.obl-badge-draft     { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.obl-empty-state { text-align: center; padding: 48px 20px; color: var(--obl-muted); }
.obl-empty-state p { margin-bottom: 18px; font-size: 0.97rem; }

/* ── Poet Author Box ─────────────────────────────────────────────────────── */

.obl-author-box {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-top: 48px;
    padding: 28px 32px;
    background: #fff;
    border: 1px solid var(--obl-border);
    border-top: 3px solid var(--obl-gold);
    border-radius: var(--obl-radius);
    box-shadow: var(--obl-shadow);
    font-family: var(--obl-font);
    clear: both;
}

.obl-author-avatar-wrap { flex-shrink: 0; }

.obl-author-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--obl-border);
}

.obl-author-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--obl-green);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.obl-author-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.obl-author-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--obl-gold);
    line-height: 1;
}

.obl-author-name {
    font-family: var(--obl-font-head);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--obl-text);
    margin: 0;
    line-height: 1.2;
}

.obl-author-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--obl-green);
    background: var(--obl-green-l);
    border: 1px solid #86efac;
    padding: 2px 10px;
    border-radius: 20px;
    width: fit-content;
}

.obl-author-bio {
    font-size: 0.9rem;
    color: var(--obl-muted);
    line-height: 1.65;
    margin: 4px 0 0;
}

.obl-author-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--obl-blue);
    text-decoration: none;
}

.obl-author-link:hover {
    text-decoration: underline;
    color: var(--obl-blue-d);
}

@media (max-width: 520px) {
    .obl-author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 18px;
        gap: 16px;
    }
    .obl-author-badge { margin: 0 auto; }
    .obl-author-link  { justify-content: center; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .obl-card  { padding: 20px 14px; margin: 10px 8px; }
    .obl-two-col { grid-template-columns: 1fr; }
    .obl-dashboard-header { flex-direction: column; }
    .obl-stats-row { flex-direction: column; gap: 0; }
    .obl-stat { border-bottom: 1px solid var(--obl-border); }
    .obl-stat:last-child { border-bottom: none; }
    .obl-post-item { flex-direction: column; align-items: flex-start; }
    .obl-post-title { max-width: 100%; }

    /* Compact form header */
    .obl-form-header { margin-bottom: 16px; }
    .obl-form-header h2 { font-size: 1.25rem; }
    .obl-form-header p  { font-size: 0.85rem; }

    /* Form gaps */
    .obl-form { gap: 14px; }

    /* Compact textarea */
    .obl-lyrics-textarea {
        font-size: 1.1rem;
        line-height: 2.2;
        padding: 14px 14px;
        min-height: 140px;
    }

    /* ── Sticky editor toolbar on mobile ──────────────────────────────────── */
    /* Sticks at top of viewport as lyrics grow and user scrolls down */
    .obl-editor-toolbar {
        position: sticky;
        top: 0;
        z-index: 40;
        border-radius: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
    }

    /* Remove top border-radius from keyboard wrap when toolbar is sticky */
    .obl-keyboard-wrap { border-radius: 0; }

    /* ── On-screen keyboard: horizontally scrollable on mobile ───────────── */
    .obl-keyboard-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 8px;
    }
    .obl-kb-row {
        justify-content: flex-start;
        flex-wrap: nowrap;
        min-width: max-content;
        gap: 4px;
    }
    .obl-key { width: 36px; height: 40px; padding: 2px 1px; }
    .obl-key-main { font-size: 0.95rem; margin-top: 4px; }
    .obl-key-rom  { font-size: 8px; }
    .obl-key-shift { font-size: 9px; }
    .obl-key-space { min-width: 100px; width: 100px; }
    .obl-key-shift-btn { width: 46px; }
    .obl-key-bs    { width: 46px; }
    .obl-key-enter { width: 50px; }

    /* ── Editor footer compact ────────────────────────────────────────────── */
    .obl-editor-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 6px 10px;
    }
    .obl-typing-hint { font-size: 0.7rem; }

    /* Toolbar items compact */
    .obl-kb-toggle-btn { padding: 4px 8px; font-size: 0.75rem; }
    .obl-char-count    { font-size: 0.72rem; }
}
