/* 관리자 페이지 전용 스타일 - nurisoft 디자인 통합 */

.admin-container {
    min-height: 100vh;
    background-color: var(--bg-light);
    padding: 1rem 0 120px 0; /* 하단 패널을 위한 여유 공간 */
}

/* 관리자 헤더 - 컴팩트 버전 */
.admin-header {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.admin-header-left h2 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 0.2rem;
}

.admin-header-left p {
    color: var(--text-light);
    font-size: 0.8rem;
}

.admin-header-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* 컨트롤 섹션 - 컴팩트 버전 */
.controls-section {
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.search-box {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 0.6rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 통계 섹션 - 관리자 헤더에 통합 */
.stats-section {
    display: none; /* 기존 섹션 숨김 - 헤더에 통합됨 */
}

/* 헤더에 통합된 미니 통계 카드 */
.admin-header-right .mini-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 2px solid var(--border-color);
}

.admin-header-right .mini-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header-right .mini-stat-icon {
    font-size: 1.5rem;
}

.admin-header-right .mini-stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-header-right .mini-stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.admin-header-right .mini-stat-label {
    color: var(--text-light);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-top: 0.15rem;
}

.admin-header-right .mini-refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    margin-right: 1rem;
}

.admin-header-right .mini-refresh-btn:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: var(--shadow-lg);
}

/* 구버전 스타일 유지 (반응형용) */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    flex: 1;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.refresh-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.refresh-btn:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: var(--shadow-lg);
}

/* 테이블 섹션 */
.table-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: fit-content;
    border-collapse: collapse;
    background: white;
    position: relative;
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.75rem 0.5rem; /* 패딩 조정 */
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 0.7rem; /* 폰트 크기 약간 축소 */
    white-space: nowrap;
}

td {
    padding: 0.75rem 0.5rem; /* 패딩 조정 */
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem; /* 폰트 크기 약간 축소 */
    vertical-align: middle;
    white-space: nowrap; /* 기본적으로 줄바꿈 방지 */
}

tr:hover {
    background: var(--bg-light);
}

tr.selected {
    background: #e3f2fd !important;
}

/* 열 너비 설정 - 고정 열과 스크롤 열 */
/* 고정 열 (체크박스 ~ 상호) */
th:nth-child(1), td:nth-child(1) { 
    width: 50px; 
    min-width: 50px;
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 10;
}

th:nth-child(2), td:nth-child(2) { 
    width: 90px; 
    min-width: 90px;
    position: sticky;
    left: 50px;
    background: inherit;
    z-index: 10;
}

th:nth-child(3), td:nth-child(3) { 
    width: 100px; 
    min-width: 100px;
    position: sticky;
    left: 140px;
    background: inherit;
    z-index: 10;
}

th:nth-child(4), td:nth-child(4) { 
    width: 90px; 
    min-width: 90px;
    position: sticky;
    left: 240px;
    background: inherit;
    z-index: 10;
}

th:nth-child(5), td:nth-child(5) { 
    width: 90px; 
    min-width: 90px;
    position: sticky;
    left: 330px;
    background: inherit;
    z-index: 10;
}

th:nth-child(6), td:nth-child(6) { 
    width: 70px; 
    min-width: 70px;
    position: sticky;
    left: 420px;
    background: inherit;
    z-index: 10;
}

th:nth-child(7), td:nth-child(7) { 
    width: 120px; 
    min-width: 120px;
    position: sticky;
    left: 490px;
    background: inherit;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); /* 고정 영역과 스크롤 영역 구분선 */
}

/* 스크롤 열 (연락처 ~ 관리) */
th:nth-child(8), td:nth-child(8) { width: 130px; min-width: 130px; } /* 연락처 */
th:nth-child(9), td:nth-child(9) { width: 180px; min-width: 180px; } /* 이메일 */
th:nth-child(10), td:nth-child(10) { width: 140px; min-width: 140px; } /* 비고 */
th:nth-child(11), td:nth-child(11) { width: 280px; min-width: 280px; white-space: normal; } /* 등록 프로그램 */
th:nth-child(12), td:nth-child(12) { width: 130px; min-width: 130px; } /* 가입일 */
th:nth-child(13), td:nth-child(13) { width: 130px; min-width: 130px; } /* 최근 접속 */
th:nth-child(14), td:nth-child(14) { width: 120px; min-width: 120px; } /* 관리 */

/* 고정된 셀의 배경색 - hover 시에도 유지 */
tr:hover td:nth-child(1),
tr:hover td:nth-child(2),
tr:hover td:nth-child(3),
tr:hover td:nth-child(4),
tr:hover td:nth-child(5),
tr:hover td:nth-child(6),
tr:hover td:nth-child(7) {
    background: var(--bg-light);
}

tr.selected td:nth-child(1),
tr.selected td:nth-child(2),
tr.selected td:nth-child(3),
tr.selected td:nth-child(4),
tr.selected td:nth-child(5),
tr.selected td:nth-child(6),
tr.selected td:nth-child(7) {
    background: #e3f2fd !important;
}

/* 헤더 고정 열 배경 */
th:nth-child(1),
th:nth-child(2),
th:nth-child(3),
th:nth-child(4),
th:nth-child(5),
th:nth-child(6),
th:nth-child(7) {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* 일반 셀 고정 열 배경 */
td:nth-child(1),
td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
    background: white;
}

/* 상태 표시 */
.status-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 0.4rem;
    animation: pulse 2s infinite;
}

.status-offline {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    margin-right: 0.4rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 0.75rem;
    font-weight: 500;
}

/* 사용자 유형 뱃지 */
.admin-type, .user-type {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.admin-type {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.user-type {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.points {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* 버튼 스타일 - 컴팩트 버전 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* 작은 버튼들 */
.delete-btn, .change-password-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.7rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    display: inline-block;
    min-width: 90px;
    text-align: center;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.change-password-btn {
    background: #17a2b8;
    color: white;
}

.change-password-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* 체크박스 */
.user-checkbox {
    transform: scale(1.2);
    cursor: pointer;
}

#selectAll {
    transform: scale(1.2);
    cursor: pointer;
}

/* 포인트 조절 패널 */
.point-control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
}

.point-control-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.selected-users-info {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    min-width: 150px;
}

.point-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.point-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.point-input-group label {
    color: white;
    font-weight: 500;
}

.point-input-group input {
    width: 120px;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
}

.point-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* 로딩 및 에러 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem;
    border: 1px solid #f5c6cb;
}

/* 백업 섹션 스타일 */
.backup-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.backup-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.75rem;
    font-size: 1.25rem;
}

.server-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.server-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.server-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.status-indicator {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-indicator.online {
    background: #d4edda;
    color: #155724;
}

.status-indicator.offline {
    background: #f8d7da;
    color: #721c24;
}

.status-indicator.checking {
    background: #fff3cd;
    color: #856404;
}

.server-details {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.server-details div {
    padding: 0.25rem 0;
}

.backup-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.backup-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.backup-info p {
    margin: 0.5rem 0;
    color: var(--text-light);
}

/* 프로그램 관리 */
.program-list-container {
    min-height: 60px;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* 프로그램 목록 컨테이너 */
.program-list-container {
    min-height: 50px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.program-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.program-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.program-name {
    font-weight: 500;
}

.program-date {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-left: 0.25rem;
}

.program-remove-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    margin-left: 0.25rem;
    font-weight: bold;
    font-size: 1.2rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.program-remove-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .server-status {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-header-right {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .point-control-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .backup-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 힌트 질문 박스 */
.hint-question-box {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-light);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* 경고 메시지 */
.warning-message {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #ffeeba;
}

/* 비교 테이블 (정렬 비교용) */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.comparison-box {
    padding: 1.5rem;
    border-radius: 8px;
}

.comparison-box.before {
    background: #ffebee;
    border: 2px solid #ef5350;
}

.comparison-box.after {
    background: #e8f5e9;
    border: 2px solid #66bb6a;
}

.comparison-box h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.comparison-box.before h4 {
    color: #c62828;
}

.comparison-box.after h4 {
    color: #2e7d32;
}

.comparison-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comparison-box li {
    padding: 0.5rem 0;
    color: var(--text-light);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.comparison-box li:last-child {
    border-bottom: none;
}

