/* ============================================
   관리자 페이지 전용 스타일
   ============================================ */

/* 레이아웃 */
body {
    display: flex;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.admin-sidebar {
    width: 250px;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 0;
}

.admin-logo {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-logo h2 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-nav {
    padding: 2rem 0;
}

.admin-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.admin-nav .nav-item span {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

.admin-nav .nav-item:hover,
.admin-nav .nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-nav hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 1rem 0;
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    padding: 2rem;
    background: #f5f5f5;
    min-height: 100vh;
}

/* 헤더 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 2rem;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* KPI 카드 */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
}

.kpi-icon {
    font-size: 2.5rem;
}

.kpi-content h3 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.kpi-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

/* 빠른 액션 */
.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 최근 활동 */
.recent-activity {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recent-activity h2 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f9f9f9;
}

.activity-icon {
    font-size: 1.5rem;
}

.activity-content p {
    margin: 0.25rem 0;
}

.activity-detail {
    font-size: 0.875rem;
    color: #666;
}

.activity-time {
    font-size: 0.75rem;
    color: #999;
}

/* 필터 탭 */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.status-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.status-tab:hover {
    background: #f0f0f0;
}

.status-tab.active {
    background: #667eea;
    color: white;
}

/* 벌크 액션 */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bulk-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* 테이블 */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #f9f9f9;
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #666;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}

.admin-table tbody tr:hover {
    background: #f9f9f9;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-unpublished {
    background: #f8d7da;
    color: #721c24;
}

.status-under_review {
    background: #fff3cd;
    color: #856404;
}

/* 토글 스위치 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #667eea;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

/* 우선 노출 입력 */
.priority-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

/* 버튼 아이콘 */
.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 버튼 */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* 로딩 */
.loader {
    text-align: center;
    padding: 2rem;
    color: #667eea;
    font-weight: 500;
}

.loading {
    text-align: center;
    color: #999;
    padding: 2rem;
}

/* 반응형 */
@media (max-width: 768px) {

    /* Sidebar -> Bottom Nav */
    .admin-sidebar {
        width: 100%;
        height: auto;
        min-height: auto;
        top: auto;
        bottom: 0;
        padding: 0;
        z-index: 1000;
        display: flex;
        justify-content: center;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        flex-direction: row;
    }

    .admin-logo {
        display: none;
    }

    .admin-nav {
        display: flex;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        margin: 0;
    }

    .admin-nav .nav-item {
        flex-direction: column;
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
        gap: 4px;
        flex: 1;
        justify-content: center;
    }

    .admin-nav .nav-item span {
        margin-right: 0;
        font-size: 1.25rem;
        margin-bottom: 2px;
    }

    .admin-nav hr {
        display: none;
    }

    /* Main Content */
    .admin-main {
        margin-left: 0;
        margin-bottom: 80px;
        /* Bottom nav height */
        padding: 1rem;
    }

    /* Header */
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-header h1 {
        font-size: 1.5rem;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
        background: white;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    /* KPI Cards */
    .kpi-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Filters & Actions */
    .filter-tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .status-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-actions label {
        margin-bottom: 0.5rem;
    }

    .bulk-select {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-secondary {
        width: 100%;
    }

    /* Table */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-right: -1rem;
        /* Allow scrolling to edge */
        padding-right: 1rem;
    }

    .admin-table {
        min-width: 600px;
        /* Ensure table doesn't squash too much */
    }

    .admin-table th,
    .admin-table td {
        white-space: nowrap;
        padding: 0.75rem;
    }

    /* Quick Actions */
    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}