/* ============================================
   댓글 자동 이메일 관리 페이지 공통 CSS
   ============================================ */

/* 관리 페이지 설명 텍스트 */
.tool-description {
    font-size: 14px;
    color: var(--text-muted, #636E72);
    margin-bottom: 16px;
}
.tool-description a {
    color: #4285f4;
    text-decoration: none;
    font-weight: 500;
}
.tool-description a:hover {
    text-decoration: underline;
}

/* 관리 페이지 버튼 보완 (style.css .btn 확장) */
.btn {
    background-color: var(--card-bg, #fff);
    color: var(--text-color, #2D3436);
    text-decoration: none;
    border: 2px solid var(--border-color, #DFE6E9);
}
.btn:hover {
    background-color: var(--bg-color, #FAFAFA);
    border-color: var(--brand-yellow, #F2C94C);
}
.btn-primary {
    border-color: var(--brand-yellow, #F2C94C);
}
.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md, 12px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    background: var(--card-bg, #fff);
    color: #e17055;
    border: 2px solid #e17055;
    text-decoration: none;
}
.delete-btn:hover {
    background: #fbe9e7;
}

/* 통계 카드 그리드 */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}
.stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #DFE6E9);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.stat-card .stat-emoji {
    font-size: 24px;
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color, #2D3436);
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted, #636E72);
    margin-top: 4px;
}

/* 바로가기 링크 */
.admin-quick-links {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.quick-link-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--brand-yellow-light, #FCE4A0);
    border-radius: var(--radius-md, 12px);
    text-decoration: none;
    color: var(--text-color, #2D3436);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border: 1px solid transparent;
    cursor: pointer;
}
.quick-link-card:hover {
    border-color: var(--brand-yellow, #F2C94C);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.quick-link-card:disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
    border-color: transparent;
    box-shadow: none;
}

/* 섹션 */
.admin-section {
    margin: 32px 0;
}
.admin-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-yellow, #F2C94C);
}

/* 테이블 */
.admin-table-wrap {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color, #DFE6E9);
    text-align: left;
    white-space: nowrap;
}
.admin-table th {
    background: var(--bg-color, #FAFAFA);
    font-weight: 600;
    color: var(--text-muted, #636E72);
}
.admin-table tr:hover td {
    background: #fafbfc;
}

/* 뱃지 */
.badge-success {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
}
.badge-failed {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #fbe9e7;
    color: #c62828;
}

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    width: 42px;
    height: 22px;
    display: inline-block;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 22px;
    transition: 0.3s;
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--brand-yellow, #F2C94C);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 모달 */
.admin-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.admin-modal-content {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.admin-modal-content.modal-wide {
    max-width: 640px;
}
.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}
.admin-modal-header h3 {
    margin: 0;
    font-size: 18px;
}
.admin-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted, #636E72);
}
.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 24px;
}

/* 폼 */
.admin-form-group {
    padding: 8px 24px;
}
.admin-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #636E72);
    margin-bottom: 6px;
}
.admin-form-group input[type="text"],
.admin-form-group input[type="email"],
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color, #DFE6E9);
    border-radius: var(--radius-md, 12px);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    outline: none;
    border-color: var(--brand-yellow, #F2C94C);
    box-shadow: 0 0 0 3px rgba(242,201,76,0.15);
}
.admin-hint {
    font-size: 12px;
    color: var(--text-muted, #636E72);
    margin-top: 4px;
}

/* 직접 메일 발송 미리보기 */
.direct-preview {
    margin: 4px 24px 0;
    border: 1px solid var(--border-color, #DFE6E9);
    border-radius: var(--radius-md, 12px);
    background: var(--bg-soft, #F8F9FA);
    overflow: hidden;
}
.direct-preview-subject {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #2D3436);
    border-bottom: 1px solid var(--border-color, #DFE6E9);
}
.direct-preview-body {
    margin: 0;
    padding: 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted, #636E72);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    max-height: 240px;
    overflow-y: auto;
}

/* 필터 영역 */
.admin-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-color, #FAFAFA);
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border-color, #DFE6E9);
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #636E72);
}
.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid var(--border-color, #DFE6E9);
    border-radius: var(--radius-md, 12px);
    font-size: 14px;
}

/* 실행 결과 로그 */
.process-logs {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: var(--radius-md, 12px);
    font-size: 13px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 페이지네이션 */
.page-btn {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid var(--border-color, #DFE6E9);
    border-radius: 6px;
    background: var(--card-bg, #fff);
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: var(--text-color, #2D3436);
}
.page-btn.active {
    background: var(--brand-yellow, #F2C94C);
    border-color: var(--brand-yellow, #F2C94C);
    font-weight: 600;
}
