/* 관리자 페이지 공통 스타일 */

/* 기본 레이아웃 */
.admin-body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}

.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.admin-header {
    background: #2d3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

.admin-nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.admin-nav-tab {
    padding: 15px 25px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    transition: background 0.2s;
}

.admin-nav-tab.active {
    background: white;
    border-bottom: 2px solid #2d3e50;
}

.admin-nav-tab:hover {
    background: #e9ecef;
}

.admin-content {
    padding: 30px;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* 폼 스타일 */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.admin-form-group input, 
.admin-form-group select, 
.admin-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.admin-form-group textarea {
    height: 100px;
    resize: vertical;
}

/* 버튼 스타일 */
.admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

.admin-btn-primary {
    background: #2d3e50;
    color: white;
}

.admin-btn-success {
    background: #28a745;
    color: white;
}

.admin-btn-danger {
    background: #dc3545;
    color: white;
}

.admin-btn:hover {
    opacity: 0.9;
}

/* 테이블 스타일 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th, 
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

/* 상태 배지 */
.admin-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.admin-status-active {
    background: #d4edda;
    color: #155724;
}

.admin-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 알림 스타일 */
.admin-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.admin-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admin-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 정렬 컨트롤 스타일 */
.sort-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.sort-controls h3 {
    margin: 0 0 15px 0;
    color: #2d3e50;
    font-size: 16px;
}

.sort-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.sort-group {
    display: flex;
    flex-direction: column;
}

.sort-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.sort-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.sort-group input[type="checkbox"] {
    margin-right: 8px;
}

.sort-group:last-child {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .sort-options {
        grid-template-columns: 1fr;
    }
    
    .sort-group:last-child {
        grid-column: 1;
        flex-direction: column;
        align-items: stretch;
    }
}

/* 표시 설정 스타일 */
.display-settings {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.display-settings h3 {
    margin: 0 0 10px 0;
    color: #2d3e50;
    font-size: 18px;
}

.display-settings p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.sort-explanation {
    background: #e9ecef;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 4px solid #667eea;
}

.sort-explanation h4 {
    margin: 0 0 15px 0;
    color: #2d3e50;
    font-size: 16px;
}

.sort-explanation ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.sort-explanation li {
    margin-bottom: 8px;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.sort-explanation p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    font-style: italic;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.preview-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.preview-section h4 {
    margin: 0 0 10px 0;
    color: #2d3e50;
    font-size: 16px;
}

.preview-section p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}

.preview-list {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

.preview-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-item .site-title {
    font-weight: 600;
    color: #2d3e50;
}

.preview-item .site-info {
    font-size: 12px;
    color: #6c757d;
}

.preview-item .sort-order {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

/* 로그인 페이지 스타일 */
.login-body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #2d3e50;
    margin: 0;
    font-size: 28px;
}

.login-header p {
    color: #666;
    margin: 10px 0 0 0;
}

.login-form-group {
    margin-bottom: 20px;
}

.login-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.login-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.login-form-group input:focus {
    outline: none;
    border-color: #2d3e50;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #2d3e50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #1a2533;
}

.login-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.login-success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
}

.login-info h4 {
    margin: 0 0 10px 0;
    color: #2d3e50;
}

.login-info p {
    margin: 5px 0;
    color: #555;
    font-size: 14px;
}

.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
}

.login-links a:hover {
    text-decoration: underline;
}

/* 통계 페이지 스타일 */
.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    /* background: white; */
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0,0,0,0.1); */
    overflow: hidden;
    padding: 20px;
}

.stats-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.stats-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.stats-header p {
    margin: 0;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-group {
    display: flex;
    gap: 15px;
}

.stat-group .stat-card {
    flex: 1;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #2d3e50;
    font-size: 16px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.chart-title {
    margin: 0 0 20px 0;
    color: #2d3e50;
    font-size: 18px;
}

.popular-pages {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.page-item:last-child {
    border-bottom: none;
}

.page-info {
    flex: 1;
}

.page-title {
    font-weight: 600;
    color: #2d3e50;
    margin-bottom: 4px;
}

.page-url {
    color: #666;
    font-size: 14px;
}

.page-stats {
    text-align: right;
}

.page-views {
    font-weight: bold;
    color: #667eea;
}

.last-visit {
    font-size: 12px;
    color: #999;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.refresh-btn:hover {
    background: #5a6fd8;
}

.date-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.search-btn:hover {
    background: #218838;
}

.reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.reset-btn:hover {
    background: #5a6268;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .stats-container {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input {
        width: 100%;
        box-sizing: border-box;
    }
}
