/* ============================================================
   NjoomTube v3 — style.css
   ============================================================ */

:root {
    --red:     #b92b27;
    --red-d:   #8f201d;
    --border:  #e3e3e3;
    --bg:      #f8f8f8;
    --text:    #1a1a1a;
    --muted:   #777;
    --radius:  10px;
}

/* ── Wrapper ───────────────────────────────────────────────── */
.njt-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 16px 48px;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    color: var(--text);
}
.njt-wrap * { box-sizing: border-box; }

/* ── Search Section ───────────────────────────────────────── */
.njt-search-section {
    margin-bottom: 32px;
}

/* ── Logo ──────────────────────────────────────────────────── */
.njt-logo-center {
    text-align: center;
    margin-bottom: 22px;
}
.njt-logo-center a  { text-decoration: none; }
.njt-logo-center img { max-height: 90px; width: auto; }
.njt-logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--red);
    letter-spacing: -.5px;
}

/* ── Search Box ────────────────────────────────────────────── */
.njt-search-wrap {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}
.njt-search-box {
    display: flex;
    background: #fff;
    border: 2px solid var(--red);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 3px 16px rgba(185,43,39,.15);
    transition: box-shadow .2s;
}
.njt-search-box:focus-within {
    box-shadow: 0 4px 24px rgba(185,43,39,.25);
}
.njt-search-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 14px 20px;
    font-size: 1rem;
    background: transparent;
    color: var(--text);
    font-family: inherit;
}
.njt-search-input.njt-shake {
    animation: njt-shake .4s;
}
@keyframes njt-shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-7px); }
    75%      { transform: translateX(7px); }
}

.njt-search-btn {
    background: var(--red);
    border: none;
    width: 54px;
    min-width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
}
.njt-search-btn:hover    { background: var(--red-d); }
.njt-search-btn:disabled { opacity: .65; cursor: default; }
.njt-search-btn.njt-btn-loading svg {
    animation: njt-spin .7s linear infinite;
}
@keyframes njt-spin { to { transform: rotate(360deg); } }

/* ── Suggestions ───────────────────────────────────────────── */
.njt-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    left: 54px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    max-height: 280px;
    overflow-y: auto;
}
.njt-suggestions li {
    padding: 10px 18px;
    cursor: pointer;
    font-size: .94rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background .1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.njt-suggestions li:last-child { border-bottom: none; }
.njt-suggestions li:hover,
.njt-suggestions li.njt-active {
    background: #fef0f0;
    color: var(--red);
}

/* ── Inline Error ──────────────────────────────────────────── */
.njt-inline-error {
    text-align: center;
    color: #c0392b;
    background: #fdf3f3;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 10px 16px;
    margin-top: 10px;
    font-size: .9rem;
}

/* ── Page Title ────────────────────────────────────────────── */
.njt-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--red);
    text-align: center;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

/* ── Loading ───────────────────────────────────────────────── */
.njt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    color: var(--muted);
    font-size: 1rem;
}
.njt-spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid #ddd;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: njt-spin .65s linear infinite;
    flex-shrink: 0;
}

/* ── Items List ─────────────────────────────────────────────── */
.njt-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.njt-no-results {
    text-align: center;
    color: var(--muted);
    padding: 36px;
}

/* ── Single Item ─────────────────────────────────────────────── */
.njt-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
}
.njt-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.09);
    transform: translateY(-1px);
}

.njt-item-top {
    display: flex;
    gap: 14px;
    padding: 14px;
    align-items: flex-start;
}
.njt-thumb { flex-shrink: 0; }
.njt-thumb img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.njt-info { flex: 1; min-width: 0; }
.njt-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.55;
    margin-bottom: 8px;
    word-break: break-word;
}
.njt-duration {
    font-size: .84rem;
    color: var(--muted);
}

.njt-item-bottom {
    border-top: 1px solid #f0f0f0;
    padding: 10px 14px;
}
.njt-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.njt-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--red);
    color: #fff !important;
    border: none;
    border-radius: 7px;
    padding: 9px 18px;
    cursor: pointer;
    font-size: .9rem;
    font-family: inherit;
    font-weight: 600;
    transition: background .18s, transform .1s;
    white-space: nowrap;
    text-decoration: none;
}
.njt-btn:hover  { background: var(--red-d); }
.njt-btn:active { transform: scale(.97); }
.njt-btn svg    { flex-shrink: 0; }

.njt-player-box {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}
.njt-player-box:empty { display: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 580px) {
    .njt-item-top  { flex-direction: column-reverse; }
    .njt-thumb img { width: 100%; height: auto; max-height: 200px; }
    .njt-btn       { flex: 1; justify-content: center; }
    .njt-page-title { font-size: 1.1rem; }
    .njt-search-btn { width: 46px; min-width: 46px; }
}
