/**
 * 관리자 페이지 전용 스타일
 */

/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-break: keep-all;
    text-wrap: balance;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 관리자 레이아웃 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 */
.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #fff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.admin-sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.admin-sidebar-nav {
    list-style: none;
    padding: 10px 0;
}

.admin-sidebar-nav li {
    margin: 5px 0;
}

.admin-sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
    background-color: #34495e;
    color: #fff;
}

/* 메인 콘텐츠 */
.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.admin-header {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user-name {
    font-weight: 500;
}

.admin-logout-btn {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.admin-logout-btn:hover {
    background-color: #c0392b;
}

/* 카드 */
.admin-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.admin-card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.admin-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* 통계 카드 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.admin-stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-stat-card h4 {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.admin-stat-card .stat-value {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
}

/* 테이블 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

/* 폼 */
.admin-form {
    max-width: 600px;
}

.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.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 input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* 버튼 */
.admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.admin-btn-primary {
    background-color: #3498db;
    color: #fff;
}

.admin-btn-primary:hover {
    background-color: #2980b9;
}

.admin-btn-success {
    background-color: #27ae60;
    color: #fff;
}

.admin-btn-success:hover {
    background-color: #229954;
}

.admin-btn-danger {
    background-color: #e74c3c;
    color: #fff;
}

.admin-btn-danger:hover {
    background-color: #c0392b;
}

.admin-btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.admin-btn-secondary:hover {
    background-color: #7f8c8d;
}

/* 로그인 페이지 */
.admin-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-login-card {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-login-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.admin-login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.admin-login-form .admin-form-group {
    margin-bottom: 20px;
}

.admin-login-form .admin-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.admin-error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.admin-success-message {
    background-color: #efe;
    color: #3c3;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

/* 페이징 */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.admin-pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.admin-pagination button:hover:not(:disabled) {
    background-color: #f8f9fa;
}

.admin-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-pagination .page-info {
    padding: 8px 12px;
}

/* 로딩 */
.admin-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 반응형 */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
}



table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child:before, table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child:before {
    content: '▷ ';
}
table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td:first-child:before, table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th:first-child:before {
    content: '▽ ';
    background-color: transparent;
}
table.dataTable thead th {
    background-color: #ffd700;
    color: #333;
    font-weight: bold;
}
table.dataTable tbody tr:nth-child(even) {
    background-color: #ffffe0;
}
table.dataTable tbody tr:nth-child(odd) {
    background-color: #e6f3ff;
}

/* 구독 상품 설정 카드 스타일 */
.card-outline {
    border-top: 3px solid;
    transition: all 0.3s ease;
}

.card-outline:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-outline.card-primary {
    border-top-color: #007bff;
}

.card-outline.card-success {
    border-top-color: #28a745;
}

.card-outline.card-warning {
    border-top-color: #ffc107;
}

.card-outline .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 15px;
}

.card-outline .card-header .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.card-outline .card-body {
    padding: 15px;
}

.card-outline .form-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}

.card-outline .form-group label i {
    color: #6c757d;
    width: 16px;
}

/* 할인율 표시 */
.text-success {
    font-weight: 500;
}

/* 사이트 설정 - 큰 스위치 (구독/이용권 옵션) */
.settings-switch-large .custom-control {
    min-height: 2.25rem;
}
.settings-switch-large .custom-control-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    padding-left: 4rem;
    padding-top: 0.15rem;
    cursor: pointer;
}
.settings-switch-large .custom-control-label::before {
    width: 3.5rem;
    height: 1.85rem;
    border-radius: 1.85rem;
    left: 0;
    top: 0.1rem;
    background-color: #dee2e6;
    border: 1px solid #adb5bd;
}
.settings-switch-large .custom-control-label::after {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    left: 0.2rem;
    top: 0.35rem;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.settings-switch-large .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #28a745;
    border-color: #28a745;
}
.settings-switch-large .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(1.65rem);
}
.settings-switch-large .form-text.text-muted {
    font-size: 1rem;
    margin-top: 0.35rem;
    margin-left: 4rem;
}

/* 업체 관리 - 상품 상세 이미지 (product-detail과 동일: 메인 이미지 + 하단 썸네일) */
.admin-product-images .product-image-slider {
    width: 100%;
    position: relative;
    background-color: #f1f3f5;
    aspect-ratio: 1;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
}
.admin-product-images .product-image-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.admin-product-images .product-image-slider .product-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #f1f3f5;
    color: #6c757d;
    border-radius: 6px;
}
.admin-product-images .product-image-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.admin-product-images .product-image-arrow:hover:not(.disabled) {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
.admin-product-images .product-image-arrow.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.admin-product-images .product-image-arrow-left { left: 8px; }
.admin-product-images .product-image-arrow-right { right: 8px; }
.admin-product-images .product-image-arrow svg { width: 20px; height: 20px; }

.admin-product-images .product-thumbnails-wrapper {
    position: relative;
    margin-top: 10px;
}
.admin-product-images .product-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}
.admin-product-images .product-thumbnails::-webkit-scrollbar { display: none; }
.admin-product-images .product-thumbnail {
    position: relative;
    width: 64px;
    height: 64px;
    min-width: 64px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.admin-product-images .product-thumbnail:hover {
    border-color: #007bff;
    opacity: 0.9;
}
.admin-product-images .product-thumbnail.active {
    border-color: #007bff;
}
.admin-product-images .product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-product-images .product-thumbnail-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f1f3f5;
    color: #6c757d;
    border-radius: 6px;
}
.admin-product-images .product-thumbnails-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.admin-product-images .product-thumbnails-arrow:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
.admin-product-images .product-thumbnails-arrow.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.admin-product-images .product-thumbnails-arrow-left { left: -14px; }
.admin-product-images .product-thumbnails-arrow-right { right: -14px; }
.admin-product-images .product-thumbnails-arrow svg { width: 16px; height: 16px; }


.admin-product-description-body {
    font-size: 15px; line-height: 1.6; white-space: normal;
}
.admin-product-description-body img {
    max-width: 100%;
}