/* ==============================
   이웃 타임라인 위젯 스타일
   라공 에디션 CSS 변수(--primary-color 등)를 그대로 사용합니다.

   .nt-dock(탭)과 .nt-panel(창)은 서로 다른 위치 상태를 갖는 독립된
   fixed 요소다 — 패널이 탭에 종속되어 움직이지 않고 화면 어디로든
   자유롭게 드래그되도록 하기 위함(script.js가 각각 top/left를 따로 관리).
============================== */

.nt-dock {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 99990;
    font-family: var(--content-font-family, inherit);
}

.nt-dock.dock-left {
    right: auto;
    left: 0;
}

/* ---------- 접힌 탭 ---------- */
.nt-tab {
    position: relative;
    width: 44px;
    height: 56px;
    border: none;
    border-radius: 12px 0 0 12px;
    background: var(--btn-primary-bg, linear-gradient(135deg, var(--primary-color), var(--accent-color)));
    color: var(--btn-primary-text, #fff);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-lg, -2px 2px 12px rgba(0, 0, 0, .18));
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.nt-dock.dock-left .nt-tab {
    border-radius: 0 12px 12px 0;
}

.nt-tab-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}
.nt-dock.dock-left .nt-tab-badge {
    left: auto;
    right: -6px;
}

/* ---------- 펼쳐진 창(패널) ---------- */
.nt-panel {
    position: fixed;
    width: 320px;
    max-width: 88vw;
    max-height: 440px;
    font-family: var(--content-font-family, inherit);
    background: var(--bg-glass, var(--container-bg-color, #fff));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--container-border-color, var(--border-light));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    z-index: 99991;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.96);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

.nt-panel.nt-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity .16s ease, transform .16s ease;
}

/* 실제 창처럼 보이도록: 타이틀바를 살짝 다른 톤으로, 위쪽 모서리만 둥글게 */
.nt-panel-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 10px 14px;
    background: var(--container-header-bg, rgba(127, 127, 127, .08));
    border-bottom: 1px solid var(--border-light, #e9e9e9);
    border-radius: 12px 12px 0 0;
    cursor: grab;
    user-select: none;
}
.nt-panel-titlebar:active {
    cursor: grabbing;
}
.nt-panel-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--title-color, inherit);
}

.nt-panel-header-actions {
    display: flex;
    gap: 2px;
}

.nt-icon-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #888);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.nt-icon-btn:hover {
    background: var(--hover-bg, rgba(0, 0, 0, .08));
    color: var(--text-primary, #333);
}
.nt-icon-btn-close:hover {
    background: #ff4757;
    color: #fff;
}

.nt-panel-body {
    overflow-y: auto;
    flex: 1;
}

.nt-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

/* ---------- 트위터 타임라인 스타일 항목 ---------- */
.nt-item a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border-light);
}
.nt-item a:hover {
    background: var(--hover-bg, rgba(0, 0, 0, .05));
}

.nt-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}
.nt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nt-item-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nt-item-headline {
    font-size: 12px;
    color: var(--text-secondary, #999);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nt-item-author {
    font-weight: 700;
    color: var(--text-primary, #333);
}

.nt-item-title {
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nt-item-thumb {
    display: block;
    margin-top: 4px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e9e9e9);
}
.nt-item-thumb img {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: cover;
}

.nt-empty {
    padding: 24px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary, #999);
}

.nt-panel-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--border-light, #e9e9e9);
    text-align: right;
}
.nt-panel-footer a {
    font-size: 12px;
    color: var(--primary-color, inherit);
    text-decoration: none;
}
.nt-panel-footer a:hover {
    text-decoration: underline;
}

.nt-icon-btn.nt-spinning i {
    animation: nt-spin 0.7s linear infinite;
}
@keyframes nt-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
    .nt-tab {
        width: 38px;
        height: 48px;
    }
    .nt-panel {
        width: calc(100vw - 32px);
    }
}
