/* 마켓 매칭 페이지 전용 스타일 */

/* 네비게이션 바 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand:hover {
    color: #f0f0f0;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.navbar-nav li {
    margin: 0;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.navbar-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 반응형 네비게이션 */
@media (max-width: 768px) {
    .navbar-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-nav {
        gap: 1rem;
    }
    
    .navbar-nav a {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* 기본 body 스타일 */
body {
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa !important;
    min-height: 100vh;
}

/* 기본 리셋 */
* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.page-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* 통계 바 */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* 탭 메뉴 */
.tab-menu {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    background: #f8f9fa;
    color: #333;
}

.tab-button.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

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

/* 메인 레이아웃 - 상품 매칭 */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    min-height: 700px;
}

/* 마켓 상품 섹션 */
.market-products-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.section-header h2 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.controls select,
.controls input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.controls select {
    min-width: 120px;
}

.controls input {
    min-width: 200px;
}

.market-products-list {
    max-height: 600px;
    overflow-y: auto;
}

.market-product-item {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-product-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.2);
}

.market-product-item.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.market-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.market-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.market-badge.coupang {
    background: #ff6b35;
}

.market-badge.naver {
    background: #03c75a;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.product-id {
    font-size: 0.9rem;
    color: #666;
}

.match-count {
    font-size: 0.8rem;
    color: #667eea;
    margin-top: 0.5rem;
}

/* 매칭 섹션 */
.matching-section {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.selected-market-product h3 {
    margin: 0 0 1rem 0;
    color: #333;
}

.product-info {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #2196f3;
    margin-bottom: 1.5rem;
}

.product-details .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-details .product-id,
.product-details .product-market {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.section-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.matched-sellmate-products,
.sellmate-search-section {
    margin-bottom: 2rem;
}

.sellmate-products-list {
    max-height: 300px;
    overflow-y: auto;
}

.search-controls {
    margin-bottom: 1rem;
}

.search-controls input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.sellmate-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.sellmate-product-info {
    flex: 1;
}

.sellmate-product-info .product-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.sellmate-product-info .product-code {
    font-size: 0.8rem;
    color: #666;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.quantity-input {
    width: 60px;
    padding: 0.25rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    text-align: center;
}

.btn-select,
.btn-match,
.btn-add,
.btn-remove,
.btn-match-all,
.btn-clear-all {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-select {
    background: #667eea;
    color: white;
}

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

.btn-add {
    background: #17a2b8;
    color: white;
}

.btn-add:hover {
    background: #138496;
}

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

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

.btn-match-all {
    background: #007bff;
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
}

.btn-match-all:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-clear-all {
    background: #6c757d;
    color: white;
}

.btn-clear-all:hover {
    background: #545b62;
}

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

.btn-remove:hover {
    background: #c82333;
}

.product-actions {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

.quantity-info {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.product-link {
    margin: 0.5rem 0;
}

.product-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
}

.product-link a:hover {
    text-decoration: underline;
}

.pagination-controls {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #dee2e6;
    margin-top: 1rem;
}

.btn-load-more {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.btn-load-more:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* 매칭할 상품 영역 스타일 */
.pending-matches-section {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.sellmate-product-item.pending {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.btn-quantity {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.btn-quantity:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.quantity-display {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    min-width: 2rem;
    text-align: center;
    font-weight: bold;
}

.match-actions {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.match-actions button {
    min-width: 150px;
    justify-content: center;
}

/* 옵션 매칭 스타일 */
.pending-option-matches-section {
    background: #f0f8ff;
    border: 2px dashed #87ceeb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.sellmate-option-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.sellmate-option-item:hover {
    border-color: #17a2b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sellmate-option-item.pending {
    background: #e8f4fd;
    border-color: #bee5eb;
}

.sellmate-option-item.compact {
    padding: 0.6rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.4rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.sellmate-option-item.compact:hover {
    border-color: #17a2b8;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.15);
    transform: translateY(-1px);
}

.sellmate-option-item.compact .option-info .option-name {
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.sellmate-option-item.compact .option-info .option-code {
    font-size: 0.8rem;
}

.sellmate-option-item.compact .option-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sellmate-option-item.compact .option-main {
    flex: 1;
}

.sellmate-option-item.compact .option-main .option-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.sellmate-option-item.compact .option-main .option-id {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.1rem;
    font-family: 'Courier New', monospace;
}

.sellmate-option-item.compact .option-main .option-details {
    font-size: 0.75rem;
    color: #17a2b8;
    font-weight: 600;
    background: #e7f7ff;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    display: inline-block;
    margin-top: 0.1rem;
}

.sellmate-option-item.compact .option-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-end;
    font-size: 0.75rem;
    min-width: 120px;
}

.sellmate-option-item.compact .option-info .option-price {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.85rem;
    background: #fff5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    border: 1px solid #f8d7da;
}

.sellmate-option-item.compact .option-info .option-stock {
    color: #495057;
    background: #f8f9fa;
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
}

.btn-add.compact {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border: none;
    border-radius: 0.3rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
    align-self: flex-start;
    margin-top: 0.2rem;
}

.btn-add.compact:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3);
}

.btn-add.compact:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(23, 162, 184, 0.2);
}

.market-option-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.market-option-item.compact {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.market-option-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.market-option-item.selected {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.option-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-main {
    flex: 1;
}

.option-main .option-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.1rem;
}

.option-main .option-id {
    font-size: 0.75rem;
    color: #666;
}

.option-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
}

.option-info .option-price {
    color: #007bff;
    font-weight: bold;
}

.option-info .option-stock {
    color: #666;
}

.option-info .option-status {
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
    font-weight: bold;
}

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

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

.btn-select.compact {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.option-name {
    font-weight: bold;
    color: #333;
}

.option-status .sale-status {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.option-details {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.option-info {
    flex: 1;
}

.option-info .option-name {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.option-info .option-code {
    font-size: 0.9rem;
    color: #666;
}

.option-actions {
    flex-shrink: 0;
}

.sellmate-options-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.pending-options-list {
    max-height: 400px;
    overflow-y: auto;
}

/* 매칭된 셀메이트 상품 스타일 */
.matched-sellmate-product-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.matched-sellmate-product-item:hover {
    border-color: #28a745;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-info {
    flex: 1;
}

.product-info .product-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #333;
}

.product-info .product-code {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.product-info .product-quantity {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: bold;
}

.option-header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-header h4 {
    margin: 0;
    color: #333;
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-back:hover {
    background: #545b62;
}

/* 마켓 옵션 목록 */
.options-list {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

/* 옵션 매칭 레이아웃 */
.option-matching-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
    min-height: 700px;
}

.matched-products-sidebar {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.matched-products-list {
    max-height: 600px;
    overflow-y: auto;
}

.matched-product-item {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matched-product-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.matched-product-item.active {
    border-color: #667eea;
    background: #e3f2fd;
}

.option-matching-main {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.selected-product-info h3 {
    margin: 0 0 1.5rem 0;
    color: #333;
}

.option-matching-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.market-options-section,
.matched-options-section {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

.options-list,
.matched-options-list {
    max-height: 400px;
    overflow-y: auto;
}

.option-item {
    padding: 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.2);
}

.option-item.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.option-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.option-id {
    font-size: 0.8rem;
    color: #666;
}

.matched-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.matched-option-info {
    flex: 1;
}

.option-pair {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.market-option,
.sellmate-option {
    flex: 1;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.market-option {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.sellmate-option {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.match-arrow {
    color: #667eea;
    font-size: 1.2rem;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.selected-market-product-display,
.selected-market-option-display {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 0.5rem;
    border-left: 4px solid #2196f3;
}

.selected-market-product-display h4,
.selected-market-option-display h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.product-display,
.option-display {
    background: white;
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
}

.sellmate-products-selection h4,
.sellmate-options-selection h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.modal-products-list,
.modal-options-list {
    display: grid;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.modal-product-item,
.modal-option-item {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal-product-item:hover,
.modal-option-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.item-info .item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.item-info .item-code {
    font-size: 0.8rem;
    color: #666;
}

.item-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* 공통 스타일 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading i {
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: #667eea;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 1rem;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .option-matching-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .option-matching-area {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .controls select,
    .controls input {
        width: 100%;
    }
    
    .modal-product-item,
    .modal-option-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* 매칭된 상품 스타일 */
.market-product-item.matched {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.match-badge {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.matched-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.matched-info i {
    color: #28a745;
}

/* 기존 매칭 상품 스타일 */
.sellmate-product-item.existing-match {
    border: 2px solid #17a2b8;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    position: relative;
}

.sellmate-product-item.existing-match::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #17a2b8, #138496);
    border-radius: 0.5rem;
    z-index: -1;
}

.sellmate-product-item.pending-match {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.existing-badge {
    background: #17a2b8;
    color: white;
}

.pending-badge {
    background: #28a745;
    color: white;
}

.sellmate-product-item.existing-match .product-name {
    color: #0c5460;
    font-weight: 600;
}

.sellmate-product-item.pending-match .product-name {
    color: #155724;
    font-weight: 600;
}

.product-details {
    margin-top: 0.5rem;
}

.product-extra-info {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}


/* 삭제 확인 모달 스타일 */
#deleteMatchModal {
    display: none !important; /* 초기에는 숨김 */
}

.warning-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.warning-message i {
    color: #856404;
    font-size: 1.5rem;
}

.warning-message p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

.delete-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.product-info {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.product-info strong {
    color: #495057;
}

.option-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.option-warning i {
    color: #17a2b8;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

/* 공통 알림 모달 스타일 */
#alertModal {
    display: none !important; /* 초기에는 숨김 */
}

.alert-modal {
    max-width: 400px;
    width: 90%;
}

.alert-message {
    text-align: center;
    padding: 1rem;
}

.alert-message p {
    margin: 0;
    font-size: 1rem;
    color: #495057;
    line-height: 1.5;
}

/* 버튼 텍스트 오버플로우 방지 */
.btn-remove {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
    max-width: 80px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.btn-remove i {
    flex-shrink: 0;
    font-size: 0.75rem;
}

.btn-remove.existing {
    min-width: 60px;
    max-width: 80px;
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-remove.existing:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

/* 수량 컨트롤 버튼 개선 */
.btn-quantity {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

/* 상품 액션 영역 개선 */
.product-actions,
.option-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* 반응형 버튼 조정 */
@media (max-width: 768px) {
    .btn-remove {
        min-width: 50px;
        max-width: 70px;
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
        gap: 0.125rem;
    }
    
    .btn-remove i {
        font-size: 0.7rem;
    }
    
    .btn-remove.existing {
        min-width: 50px;
        max-width: 70px;
    }
}

/* 매칭된 옵션 스타일 */
.sellmate-option-item.matched {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    opacity: 0.8;
}

.sellmate-option-item.matched .option-name {
    color: #155724;
    font-weight: 600;
}

.matched-badge {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: bold;
    margin-top: 0.25rem;
    display: inline-block;
}

.btn-matched {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 70px;
    justify-content: center;
}

.btn-matched:disabled {
    opacity: 0.7;
}

.btn-matched i {
    font-size: 0.75rem;
}
