/* ==================== トレカ管理スタイル ==================== */

.trading-card-summary {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trading-card-filters {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.trading-card-form-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trading-card-form-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.form-group-full {
    grid-column: 1 / -1;
}

.image-preview-container {
    margin-top: 12px;
}

.image-preview-container img {
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trading-card-list-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.list-view-toggle {
    display: flex;
    gap: 8px;
}

.list-view-toggle button.active {
    background: #4caf50;
    color: white;
}

.trading-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.trading-card-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trading-card-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.trading-card-item.sold {
    opacity: 0.7;
}

.trading-card-image {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.trading-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trading-card-image .no-image {
    color: #999;
    font-size: 14px;
}

.trading-card-info {
    padding: 16px;
}

.trading-card-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.trading-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.card-game {
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.card-rarity {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.rarity-コモン {
    background: #f5f5f5;
    color: #666;
}

.rarity-アンコモン {
    background: #e8f5e9;
    color: #2e7d32;
}

.rarity-レア {
    background: #e3f2fd;
    color: #1976d2;
}

.rarity-スーパーレア {
    background: #fff3e0;
    color: #f57c00;
}

.rarity-ウルトラレア {
    background: #f3e5f5;
    color: #7b1fa2;
}

.rarity-シークレットレア {
    background: #ffebee;
    color: #c62828;
}

.card-set {
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
}

.trading-card-prices {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.price-item:last-child {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    font-weight: 600;
}

.price-label {
    font-size: 13px;
    color: #666;
}

.price-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.profit-positive {
    color: #4caf50;
}

.profit-negative {
    color: #f44336;
}

.trading-card-status {
    margin-bottom: 12px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-stock {
    background: #e3f2fd;
    color: #1976d2;
}

.status-sold {
    background: #e8f5e9;
    color: #2e7d32;
}

.trading-card-actions {
    display: flex;
    gap: 8px;
}

.trading-card-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    grid-column: 1 / -1;
}

.trading-cards-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

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

.trading-cards-table thead {
    background: #f5f5f5;
}

.trading-cards-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.trading-cards-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.trading-cards-table tbody tr:hover {
    background: #f9f9f9;
}

.trading-cards-table tbody tr.sold-row {
    opacity: 0.7;
}

.trading-cards-table .profit-positive {
    color: #4caf50;
    font-weight: 600;
}

.trading-cards-table .profit-negative {
    color: #f44336;
    font-weight: 600;
}

/* OCRステータス */
#ocrStatus {
    font-size: 13px;
    line-height: 1.5;
}

/* カメラモーダル */
#cameraModal {
    z-index: 10000;
}

#cameraModal video {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 4px;
    background: #000;
}

#cameraModal h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#closeCameraBtn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#closeCameraBtn:hover {
    background: #f0f0f0;
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
    .trading-card-summary,
    .trading-card-filters,
    .trading-card-form-section,
    .trading-card-list-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .filter-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .trading-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .trading-card-image {
        height: 180px;
    }

    .trading-cards-table-container {
        overflow-x: auto;
    }

    .trading-cards-table {
        min-width: 800px;
        font-size: 13px;
    }

    .trading-cards-table th,
    .trading-cards-table td {
        padding: 8px;
    }
}

@media screen and (max-width: 480px) {
    .trading-card-summary,
    .trading-card-filters,
    .trading-card-form-section,
    .trading-card-list-section {
        padding: 12px;
    }

    .trading-card-image {
        height: 160px;
    }

    .trading-card-info {
        padding: 12px;
    }

    .trading-card-name {
        font-size: 14px;
    }

    .trading-cards-table {
        min-width: 700px;
        font-size: 12px;
    }
}

