/* 관리자 페이지 전용 스타일 */

/* 관리자 버튼 - 제품 페이지용 */
.admin-entry-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.admin-entry-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.admin-icon {
    font-size: 28px;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

/* 관리자 컨테이너 */
.admin-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 관리자 헤더 박스 */
.admin-header-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    text-align: center;
}

.admin-header-box h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.admin-header-box p {
    font-size: 16px;
    color: #7f8c8d;
}

.logout-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 탭 메뉴 */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-btn:hover {
    transform: translateY(-2px);
}

/* 탭 컨텐츠 */
.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

/* 폼 섹션 */
.form-section {
    margin-bottom: 30px;
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    font-size: 22px;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 이미지 업로드 */
.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 5px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #3498db;
    background: #e8f4f8;
}

.image-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid #ddd;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* 제출 버튼 */
.submit-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: #229954;
    transform: translateY(-2px);
}

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: bold;
}

/* 제품 테이블 */
.product-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.product-table th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
}

.product-table td {
    padding: 15px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

.product-table tr:hover {
    background: #f8f9fa;
}

.product-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

/* 액션 버튼 */
.action-btns {
    display: flex;
    gap: 5px;
}

.edit-btn, .delete-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    font-weight: bold;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
}

/* 검색 바 */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    min-width: 200px;
}

/* 뱃지 */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge-new {
    background: #e74c3c;
    color: white;
}

/* 알림 */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
    font-weight: bold;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ 방문자 현황 테이블 스타일 (추가) ============ */

/* 클릭 가능한 세션 행 - hover 효과 */
.product-table tbody tr[onclick] {
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-table tbody tr[onclick]:hover {
    background: #f0f8ff !important;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 세션 상세 정보 행 */
.product-table tbody tr[id^="detail-"] {
    background: #f8f9fa !important;
    border-left: 4px solid #3498db;
}

.product-table tbody tr[id^="detail-"]:hover {
    background: #f8f9fa !important;
}

/* 상세 정보 애니메이션 */
@keyframes slideDownDetail {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-table tbody tr[id^="detail-"][style*="table-row"] {
    animation: slideDownDetail 0.3s ease;
}

/* 상세 정보 내부 스타일 */
.product-table tbody tr[id^="detail-"] td {
    padding: 0 !important;
}

.product-table tbody tr[id^="detail-"] > td > div {
    padding: 20px;
}

/* 방문 페이지 목록 스크롤바 */
.product-table div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 8px;
}

.product-table div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.product-table div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.product-table div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 페이지 정보 카드 스타일 */
.product-table tbody tr[id^="detail-"] h4 {
    color: #2c3e50;
    font-size: 16px;
    margin: 15px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

.product-table tbody tr[id^="detail-"] strong {
    color: #34495e;
    font-weight: 600;
}

/* 방문 페이지 리스트 스타일 */
.product-table tbody tr[id^="detail-"] div[style*="border-bottom"] {
    transition: all 0.2s ease;
}

.product-table tbody tr[id^="detail-"] div[style*="border-bottom"]:hover {
    background: #f8f9fa;
    padding-left: 10px !important;
}

/* 반응형 */
@media (max-width: 768px) {
    .admin-container {
        padding: 0 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-tabs {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .logout-btn {
        position: static;
        margin-top: 20px;
        width: 100%;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar select {
        width: 100%;
    }

    .admin-entry-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .admin-icon {
        font-size: 24px;
    }
    
    /* 방문자 테이블 모바일 최적화 */
    .product-table {
        font-size: 12px;
    }
    
    .product-table th,
    .product-table td {
        padding: 10px 8px;
    }
    
    .product-table tbody tr[onclick]:hover {
        transform: translateX(2px);
    }
}