/* 商品管理システム スタイルシート */

.product-listing-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 検索バー */
.product-search-bar {
    margin-bottom: 30px;
}

.product-search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.product-search-form input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.product-search-form button {
    padding: 12px 30px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.product-search-form button:hover {
    background-color: #005a87;
}

/* カテゴリフィルター */
.product-categories {
    margin-bottom: 30px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
    font-size: 14px;
}

.category-btn:hover {
    background-color: #e0e0e0;
}

.category-btn.active {
    background-color: #0073aa;
    color: white;
}

/* 商品グリッド */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 商品カード */
.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.product-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
}

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

.product-content {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.4;
}

.product-meta {
    margin-bottom: 15px;
}

.product-incentive,
.product-commission {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.product-incentive strong,
.product-commission strong {
    color: #333;
    display: inline-block;
    min-width: 120px;
}

.product-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.product-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s;
    flex: 1;
    min-width: 100px;
}

.btn-details {
    background-color: #f0f0f0;
    color: #333;
}

.btn-details:hover {
    background-color: #e0e0e0;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

/* メッセージ */
.no-products {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* ページネーション */
.product-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.product-pagination .page-numbers {
    padding: 10px 15px;
    margin: 0 5px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.product-pagination .page-numbers:hover {
    background-color: #e0e0e0;
}

.product-pagination .page-numbers.current {
    background-color: #0073aa;
    color: white;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    .product-listing-wrapper {
        padding: 15px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .product-search-form {
        flex-direction: column;
    }
    
    .product-search-form input[type="text"],
    .product-search-form button {
        width: 100%;
    }
    
    .category-filter {
        justify-content: center;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .category-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* 管理者専用ページスタイル */
.admin-access-denied {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
}

.admin-access-denied h3 {
    color: #d63638;
    margin-bottom: 15px;
}

.admin-product-listing {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.admin-header h2 {
    margin: 0;
    color: #0073aa;
}

/* フィルター */
.admin-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.admin-filter-form .filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-filter-form input[type="text"],
.admin-filter-form select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.admin-filter-form input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.admin-filter-form select {
    min-width: 150px;
}

.btn-secondary {
    background-color: #0073aa;
    color: white;
}

.btn-secondary:hover {
    background-color: #005a87;
}

.btn-link {
    background-color: transparent;
    color: #666;
    text-decoration: none;
}

.btn-link:hover {
    color: #333;
    text-decoration: underline;
}

/* テーブル */
.admin-table-wrapper {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.admin-product-table thead {
    background-color: #f8f9fa;
}

.admin-product-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.admin-product-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

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

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

.admin-product-table .no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ステータスバッジ */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

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

.status-draft {
    background-color: #fff3cd;
    color: #856404;
}

.status-private {
    background-color: #e2e3e5;
    color: #383d41;
}

/* アクション */
.actions {
    white-space: nowrap;
}

.action-btn {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 3px;
    font-size: 13px;
    text-decoration: none;
    color: #0073aa;
    border-radius: 3px;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #f0f0f0;
}

.action-btn.delete {
    color: #d63638;
}

.action-btn.delete:hover {
    background-color: #ffebee;
}

.url-link {
    color: #0073aa;
    text-decoration: none;
}

.url-link:hover {
    text-decoration: underline;
}

/* ページネーション */
.admin-pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.admin-pagination .page-numbers {
    padding: 8px 12px;
    margin: 0 3px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.admin-pagination .page-numbers:hover {
    background-color: #e0e0e0;
}

.admin-pagination .page-numbers.current {
    background-color: #0073aa;
    color: white;
}

/* 統計情報 */
.admin-stats {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    color: #333;
}

/* レスポンシブ - 管理者ページ */
@media screen and (max-width: 1024px) {
    .admin-product-table {
        font-size: 14px;
    }
    
    .admin-product-table th,
    .admin-product-table td {
        padding: 10px 8px;
    }
}

@media screen and (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .admin-filter-form .filter-row {
        flex-direction: column;
    }
    
    .admin-filter-form input[type="text"],
    .admin-filter-form select,
    .btn {
        width: 100%;
    }
    
    .admin-table-wrapper {
        overflow-x: scroll;
    }
    
    .admin-product-table {
        min-width: 900px;
    }
    
    .admin-stats {
        flex-direction: column;
    }
}

@media screen and (max-width: 480px) {
    .admin-product-listing {
        padding: 10px;
    }
    
    .admin-filters {
        padding: 15px;
    }
    
    .admin-header h2 {
        font-size: 18px;
    }
}