/* =========================================================
   도란톡 (DoranTok) - 가벼운 Q&A 스타일시트
   ========================================================= */

/* 전체 래퍼 */
.dorantok-wrap {
    max-width: 100%;
    margin: 0 auto;
}

/* ── 헤더 영역 ── */
.dorantok-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0 8px;
}
.dorantok-header .dorantok-icon {
    font-size: 1.5rem;
    color: #f9a825;
}
.dorantok-header .dorantok-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4e342e;
}
.dorantok-header .dorantok-subtitle {
    font-size: 0.8rem;
    color: #a1887f;
    margin-left: 4px;
}

/* ── 카테고리 칩 바 ── */
.dorantok-chipbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe4;
}
.dorantok-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e0d6cc;
    background: #fafafa;
    color: #6d4c41;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.dorantok-chip:hover {
    background: #fff8e1;
    border-color: #ffe082;
}
.dorantok-chip.active {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-color: #ffc107;
    color: #4e342e;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255,193,7,0.2);
}

/* ── 검색 바 ── */
.dorantok-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}
.dorantok-search input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #e0d6cc;
    border-radius: 20px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}
.dorantok-search input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.15);
}
.dorantok-search button {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #6d4c41;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.dorantok-search button:hover {
    background: linear-gradient(135deg, #ffecb3, #ffe082);
    box-shadow: 0 2px 8px rgba(255,193,7,0.3);
}

/* ── 질문 작성 영역 ── */
.dorantok-write {
    background: linear-gradient(135deg, #fffdf5, #fff8e1);
    border: 1px solid #ffe082;
    border-radius: 14px;
    padding: 16px;
    margin: 12px 0;
    transition: box-shadow 0.2s;
}
.dorantok-write:focus-within {
    box-shadow: 0 4px 16px rgba(255,193,7,0.2);
}
.dorantok-write-cats {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.dorantok-write-cat {
    padding: 4px 12px;
    border-radius: 14px;
    border: 1px solid #e0d6cc;
    background: white;
    color: #8d6e63;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.dorantok-write-cat.active {
    background: #ffc107;
    border-color: #ffc107;
    color: white;
    font-weight: 600;
}
.dorantok-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.dorantok-title-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: transparent;
    font-size: 0.93rem;
    font-weight: 400;
    padding: 8px 12px;
    outline: none;
    color: #3e2723;
    font-family: inherit;
    transition: all 0.2s;
}
.dorantok-title-input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.12);
}
.dorantok-title-input::placeholder {
    color: #bcaaa4;
    font-weight: 400;
}
.dorantok-write textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: none;
    overflow: hidden;
    outline: none;
    color: #3e2723;
    min-height: auto;
    font-family: inherit;
    padding-top: 4px;
}
.dorantok-write textarea::placeholder {
    color: #bcaaa4;
}
.dorantok-write-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.dorantok-write-count {
    font-size: 0.78rem;
    color: #a1887f;
}
.dorantok-write-count.over {
    color: #e53935;
    font-weight: 600;
}
.dorantok-write-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(255,193,7,0.3);
}
.dorantok-write-btn:hover {
    background: linear-gradient(135deg, #ffb300, #ffa000);
    box-shadow: 0 3px 10px rgba(255,152,0,0.4);
    transform: translateY(-1px);
}
.dorantok-write-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── 질문 목록 ── */
.dorantok-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dorantok-item {
    padding: 4px 0;
    border-bottom: 1px solid #f0ebe4;
    animation: fadeInUp 0.3s ease;
}
.dorantok-item:last-child {
    border-bottom: none;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dorantok-item-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 6px;
    border-radius: 8px;
    transition: background-color 0.15s;
}
.dorantok-item-top:hover {
    background-color: rgba(255, 193, 7, 0.06);
}
.dorantok-q-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    color: #f9a825;
    font-weight: 800;
    font-size: 0.85rem;
    margin-top: 2px;
}
.dorantok-item-cat {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 10px;
    background: #f5f0eb;
    color: #8d6e63;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
}
.dorantok-item-title {
    flex: 1;
    min-width: 0;
    font-size: 0.92rem;
    font-weight: 400;
    color: #3e2723;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dorantok-item-title:hover {
    color: #f57f17;
}
.dorantok-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: -4px;
    font-size: 0.72rem;
    color: #a1887f;
}
.dorantok-item-meta .dot {
    color: #d7ccc8;
}
.dorantok-item-meta .reply-cnt {
    color: #f9a825;
    font-weight: 600;
}
.dorantok-item-edit,
.dorantok-item-delete {
    border: none;
    background: none;
    color: #bcaaa4;
    cursor: pointer;
    font-size: 0.70rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}
.dorantok-item-edit:hover {
    color: #1565c0;
    background: #e3f2fd;
}
.dorantok-item-delete:hover {
    color: #e53935;
    background: #fce4ec;
}

/* ── 빈 상태 ── */
.dorantok-empty {
    text-align: center;
    padding: 48px 20px;
    color: #bcaaa4;
}
.dorantok-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    color: #d7ccc8;
}
.dorantok-empty-text {
    font-size: 0.95rem;
}

/* ── 페이지네이션 ── */
.dorantok-pagination {
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 20px 0;
}
.dorantok-pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    border-right: none;
    background: white;
    color: #495057;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dorantok-pagination button:first-child {
    border-radius: 4px 0 0 4px;
}
.dorantok-pagination button:last-child {
    border-radius: 0 4px 4px 0;
    border-right: 1px solid #dee2e6;
}
.dorantok-pagination button:hover:not(:disabled):not(.active) {
    background: #e9ecef;
}
.dorantok-pagination button.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
    font-weight: 700;
    z-index: 1;
    position: relative;
}
.dorantok-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #adb5bd;
}

/* ── 로딩 스피너 ── */
.dorantok-loading {
    text-align: center;
    padding: 32px;
    color: #bcaaa4;
}
.dorantok-loading i {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── 알림 아이콘 ── */
.dorantok-notify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 4px;
    background: none;
    border: none;
    color: #2e7d32;
    filter: drop-shadow(0 0 6px rgba(46, 125, 50, 0.9)) drop-shadow(0 0 2px rgba(46, 125, 50, 0.7));
    animation: bellRing 5s ease-in-out;
    flex-shrink: 0;
}
@keyframes bellRing {
    0%   { transform: rotate(0deg) scale(1); }
    2%   { transform: rotate(15deg) scale(1.15); }
    4%   { transform: rotate(-15deg) scale(1.15); }
    6%   { transform: rotate(12deg) scale(1.1); }
    8%   { transform: rotate(-12deg) scale(1.1); }
    10%  { transform: rotate(8deg) scale(1.05); }
    12%  { transform: rotate(-8deg) scale(1.05); }
    14%  { transform: rotate(0deg) scale(1); }
    30%  { transform: rotate(0deg) scale(1); }
    32%  { transform: rotate(12deg) scale(1.12); }
    34%  { transform: rotate(-12deg) scale(1.12); }
    36%  { transform: rotate(10deg) scale(1.08); }
    38%  { transform: rotate(-10deg) scale(1.08); }
    40%  { transform: rotate(0deg) scale(1); }
    60%  { transform: rotate(0deg) scale(1); }
    62%  { transform: rotate(10deg) scale(1.1); }
    64%  { transform: rotate(-10deg) scale(1.1); }
    66%  { transform: rotate(6deg) scale(1.05); }
    68%  { transform: rotate(-6deg) scale(1.05); }
    70%  { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(0deg) scale(1); }
}

/* 칩 버튼 내 🔔 뱃지 */
.dorantok-chip-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: none;
    border: none;
    color: #2e7d32;
    margin-left: 3px;
    filter: drop-shadow(0 0 5px rgba(46, 125, 50, 0.9)) drop-shadow(0 0 2px rgba(46, 125, 50, 0.7));
    animation: bellPulse 1.5s ease-in-out infinite;
}
@keyframes bellPulse {
    0%   { transform: scale(1); filter: drop-shadow(0 0 5px rgba(46,125,50,0.8)); }
    50%  { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(46,125,50,1)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(46,125,50,0.8)); }
}

/* ── 답변 영역 ── */
.dorantok-reply-area {
    margin-left: 38px;
    padding: 2px 0 10px 0;
    animation: fadeInUp 0.3s ease;
}
.dorantok-question-body {
    padding: 10px 14px;
    margin-bottom: 10px;
    background: #fef9f0;
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #5d4037;
    word-break: break-word;
}
.dorantok-reply-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.dorantok-reply-form textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background: transparent;
    font-size: 0.88rem;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    outline: none;
    min-height: 38px;
    font-family: inherit;
    transition: all 0.2s;
}
.dorantok-reply-form textarea:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.12);
}
.dorantok-reply-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.dorantok-reply-form .reply-count {
    font-size: 0.72rem;
    color: #a1887f;
}
.dorantok-reply-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: white;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.dorantok-reply-btn:hover {
    background: linear-gradient(135deg, #ffb300, #ffa000);
    box-shadow: 0 2px 6px rgba(255,152,0,0.3);
}
.dorantok-reply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.dorantok-reply-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dorantok-reply-item {
    padding: 10px 0;
    border-top: 1px solid #f5f0eb;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.dorantok-reply-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #43a047;
    font-weight: 800;
    font-size: 0.72rem;
    margin-top: 2px;
}
.dorantok-reply-body {
    flex: 1;
    min-width: 0;
}
.dorantok-reply-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #3e2723;
    word-break: break-word;
}
.dorantok-reply-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #a1887f;
}
.dorantok-reply-delete {
    border: none;
    background: none;
    color: #bcaaa4;
    cursor: pointer;
    font-size: 0.72rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.15s;
}
.dorantok-reply-delete:hover {
    color: #e53935;
    background: #fce4ec;
}
.dorantok-reply-empty {
    padding: 12px;
    text-align: center;
    color: #bcaaa4;
    font-size: 0.85rem;
}
.dorantok-reply-toggle {
    border: none;
    background: none;
    color: #f9a825;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 4px;
    transition: color 0.15s;
}
.dorantok-reply-toggle:hover {
    color: #f57f17;
}

/* ── 대댓글 (Comment) 영역 ── */
.dorantok-comment-toggle {
    border: none;
    background: none;
    color: #78909c;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 1px 3px;
    transition: color 0.15s;
}
.dorantok-comment-toggle:hover {
    color: #455a64;
}
.dorantok-comment-area {
    margin-top: 8px;
    margin-left: 32px;
    padding: 6px 0;
    border-left: 2px solid #e8e0d8;
    padding-left: 12px;
}
.dorantok-comment-form {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    margin-top: 12px;
    align-items: flex-start;
}
.dorantok-comment-form textarea {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: transparent;
    font-size: 0.82rem;
    line-height: 1.4;
    outline: none;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    min-height: 36px;
    transition: all 0.2s;
}
.dorantok-comment-form textarea:focus {
    border-color: #78909c;
    box-shadow: 0 0 0 2px rgba(120,144,156,0.1);
}
.dorantok-comment-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 12px;
    background: #78909c;
    color: white;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.dorantok-comment-btn:hover {
    background: #546e7a;
}
.dorantok-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dorantok-comment-item {
    padding: 5px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.dorantok-comment-badge {
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.dorantok-comment-body {
    flex: 1;
    min-width: 0;
}
.dorantok-comment-text {
    font-size: 0.83rem;
    color: #3e2723;
    word-break: break-word;
    line-height: 1.4;
}
.dorantok-comment-meta {
    font-size: 0.7rem;
    color: #a1887f;
    margin-left: 6px;
    white-space: nowrap;
}
.dorantok-comment-delete {
    border: none;
    background: none;
    color: #bcaaa4;
    cursor: pointer;
    font-size: 0.68rem;
    padding: 1px 4px;
    margin-left: 4px;
    border-radius: 3px;
    transition: all 0.15s;
}
.dorantok-comment-delete:hover {
    color: #e53935;
    background: #fce4ec;
}

/* ── 모바일 반응형 ── */
@media (max-width: 768px) {
    .dorantok-write {
        padding: 12px;
        margin: 8px 0;
    }
    .dorantok-item-title {
        font-size: 0.85rem;
    }
    .dorantok-chipbar {
        gap: 4px;
    }
    .dorantok-chip {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    .dorantok-reply-area {
        margin-left: 20px;
    }
    .dorantok-comment-area {
        margin-left: 16px;
    }
}
