/* 관리자 페이지 전용 스타일 */

/* 색상 변수 */
:root {
    --primary-color: #4F46E5;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --info-color: #3B82F6;
    --sidebar-width: 260px;
    --sidebar-bg: #1F2937;
    --sidebar-text: #D1D5DB;
    --sidebar-hover: #374151;
}

/* 관리자 레이아웃 */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #F9FAFB;
}

/* 사이드바 */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.admin-sidebar-user {
    font-size: 13px;
    color: var(--sidebar-text);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-top: 12px;
}

.admin-sidebar-menu {
    padding: 20px 0;
}

.admin-sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.admin-sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.admin-sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.admin-sidebar-menu a .icon {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* 메인 콘텐츠 영역 */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    min-height: 100vh;
}

.admin-content-header {
    margin-bottom: 32px;
}

.admin-content-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.admin-content-header p {
    color: #6B7280;
    font-size: 14px;
}

/* 통계 카드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.blue {
    border-left-color: var(--info-color);
}

.stat-card.green {
    border-left-color: var(--success-color);
}

.stat-card.orange {
    border-left-color: var(--warning-color);
}

.stat-card.purple {
    border-left-color: var(--primary-color);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card-title {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.blue .stat-card-icon {
    background: #EFF6FF;
    color: var(--info-color);
}

.stat-card.green .stat-card-icon {
    background: #F0FDF4;
    color: var(--success-color);
}

.stat-card.orange .stat-card-icon {
    background: #FFFBEB;
    color: var(--warning-color);
}

.stat-card.purple .stat-card-icon {
    background: #EEF2FF;
    color: var(--primary-color);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

/* 카드 */
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.admin-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* 폼 섹션 */
.admin-form-section {
    background: #F9FAFB;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.admin-form-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 24px;
}

/* 아코디언 토글 */
.admin-form-toggle {
    width: 100%;
    padding: 20px 30px;
    background: #F9FAFB;
    border: none;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    transition: background 0.2s;
}

.admin-form-toggle:hover {
    background: #F3F4F6;
}

.admin-form-toggle .toggle-icon {
    font-size: 20px;
    transition: transform 0.3s;
}

.admin-form-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.admin-form-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 30px;
}

.admin-form-content.active {
    max-height: 3000px;
    padding: 30px;
    transition: max-height 0.5s ease-in;
}

/* 상품 추가 레이아웃 */
.product-form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 24px;
}

.product-thumbnail-upload {
    grid-row: 1 / 3;
}

.thumbnail-box {
    width: 200px;
    height: 200px;
    border: 2px dashed #D1D5DB;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #FAFAFA;
    position: relative;
    overflow: hidden;
}

.thumbnail-box:hover {
    border-color: var(--primary-color);
    background: #F9FAFB;
}

.thumbnail-box input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
    top: 0;
    left: 0;
}

.thumbnail-box .upload-icon {
    font-size: 48px;
    color: #9CA3AF;
    margin-bottom: 8px;
    pointer-events: none;
}

.thumbnail-box .upload-text {
    font-size: 13px;
    color: #6B7280;
    text-align: center;
    pointer-events: none;
}

.thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-preview {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-preview .remove-thumb {
    position: absolute;
    top: 8px;
    pointer-events: auto;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info-grid {
    display: grid;
    gap: 20px;
}

.category-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: #fff;
}

.category-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    vertical-align: middle;
}

.category-checkboxes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.category-checkboxes span {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

.price-stock-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .product-form-grid {
        grid-template-columns: 1fr;
    }
    
    .product-thumbnail-upload {
        grid-row: auto;
    }
    
    .thumbnail-box {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .price-stock-grid {
        grid-template-columns: 1fr;
    }
    
    .category-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* 테이블 개선 */
.admin-table-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: #F9FAFB;
}

.admin-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #E5E7EB;
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: #374151;
}

.admin-table tbody tr {
    transition: background-color 0.15s;
}

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

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* 상태 배지 개선 */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.status-badge.success {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.warning {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.danger {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge.info {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-badge.default {
    background: #F3F4F6;
    color: #374151;
}

/* 버튼 개선 */
.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-form-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-admin {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-admin-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-admin-primary:hover {
    background: #4338CA;
}

.btn-admin-secondary {
    background: #F3F4F6;
    color: #374151;
}

.btn-admin-secondary:hover {
    background: #E5E7EB;
}

.btn-admin-success {
    background: var(--success-color);
    color: #fff;
}

.btn-admin-success:hover {
    background: #059669;
}

.btn-admin-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-admin-danger:hover {
    background: #DC2626;
}

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

.admin-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
}

.admin-form-group input[type="text"],
.admin-form-group input[type="email"],
.admin-form-group input[type="tel"],
.admin-form-group input[type="number"],
.admin-form-group input[type="password"],
.admin-form-group input[type="date"],
.admin-form-group textarea,
.admin-form-group select {
    width: 100%;
    padding: 10px 14px;
    padding-right: 40px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.admin-form-group select {
    min-width: 180px !important;
    width: auto !important;
    max-width: 100%;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-right: 40px !important;
}

.admin-form-group select option {
    white-space: normal;
    padding: 8px 12px;
    width: 100%;
}

/* 상태 변경 select 전용 스타일 */
#status,
#bulk_status,
#shipping_company {
    min-width: 180px !important;
    width: 100% !important;
    max-width: none !important;
    height: 44px !important;
    padding: 0 40px 0 14px !important;
    line-height: 44px !important;
    text-overflow: clip !important;
    overflow: visible !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    display: inline-block !important;
}

/* 택배사 select 스타일 */
.shipping-company-select {
    height: 36px !important;
    line-height: 36px !important;
    padding: 0 30px 0 8px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.admin-form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6B7280;
}

/* 알림 */
.admin-alert {
    padding: 14px 16px;
    margin-bottom: 24px;
    border-radius: 8px;
    font-size: 14px;
    border-left: 4px solid;
}

.admin-alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left-color: var(--success-color);
}

.admin-alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left-color: var(--danger-color);
}

.admin-alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-left-color: var(--info-color);
}

/* 모바일 햄버거 메뉴 */
.admin-mobile-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--sidebar-bg);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 반응형 */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
        padding: 80px 20px 40px;
    }
    
    .admin-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-content-header h1 {
        font-size: 24px;
    }
    
    .admin-card,
    .admin-form-section {
        padding: 20px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* 로그인 페이지 */
.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    padding: 20px;
}

.admin-login-card {
    background: #fff;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px;
}

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

.admin-login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.admin-login-header p {
    color: #6B7280;
    font-size: 14px;
}

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

.admin-login-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-login-form button[type="submit"]:hover {
    background: #4338CA;
}

.admin-login-footer {
    text-align: center;
    margin-top: 24px;
}

.admin-login-footer a {
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.admin-login-footer a:hover {
    color: var(--primary-color);
}

/* 빈 상태 */
.admin-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9CA3AF;
}

.admin-empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.admin-empty-state p {
    font-size: 16px;
    color: #6B7280;
}

