/* Collections Manager Styles */

/* Collection Page Header */
.collection-page-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

/* Collection Controls */
.collection-controls {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.collection-select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 250px;
}

.collection-input {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 14px;
    min-width: 250px;
}

/* Mode Containers */
.mode-container {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Product Selection Table */
.product-selection-list {
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
}

.product-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.product-table th,
.product-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.product-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.product-table input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Collection Product Cards */
.collection-product-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.collection-product-card {
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.product-header h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: var(--text-color);
}

.product-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

/* Variant List */
.variant-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variant-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.02);
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.variant-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.variant-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
    font-size: 10px;
    border-radius: 4px;
}

.variant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variant-info strong {
    font-size: 14px;
    color: var(--text-color);
}

.variant-info span {
    font-size: 12px;
    color: #666;
}

/* Price Controls */
.price-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-control label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.price-input {
    width: 100px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
}

.price-input:read-only {
    background: #f5f5f5;
    color: #666;
}

.price-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Variant Actions */
.variant-actions {
    display: flex;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
}

/* ============================================================ */
/* NEW CARD-BASED LAYOUT */
/* ============================================================ */

/* Collections Products Grid Layout */
.collection-products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Product Card */
.product-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* LEFT SIDE - Product Info */
.card-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
}

.product-image-section {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #eee;
}

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

.no-image-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 14px;
}

.product-info {
    width: 100%;
}

.product-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    word-break: break-word;
}

.product-id {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.card-left .btn {
    width: 100%;
    padding: 10px;
    text-align: center;
}

/* RIGHT SIDE - Variants */
.card-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.variants-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.variant-control-group {
    background: rgba(102, 126, 234, 0.03);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    padding: 15px;
}

/* Variant Control Header */
.variant-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
}

.variant-nav-buttons {
    display: flex;
    gap: 8px;
}

.btn-nav-small {
    padding: 6px 12px;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-nav-small:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.btn-nav-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.variant-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

/* Variant Details Section */
.variant-details-section {
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
}

.detail-label {
    font-weight: 600;
    color: #667eea;
}

.detail-value {
    color: var(--text-color);
    font-weight: 500;
}

/* Price Section */
.price-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-label {
    font-size: 11px;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-display,
.new-price-display {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    background: #f5f5f5;
    color: #333;
    text-align: right;
}

.discount-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
    background: white;
    color: #333;
}

.discount-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Variant Actions */
.variant-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .product-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-left {
        border-bottom: 2px solid #eee;
        padding-bottom: 20px;
    }

    .product-image-section {
        max-width: 300px;
        height: 250px;
    }

    .variant-row {
        flex-wrap: wrap;
    }

    .variant-info {
        flex-basis: 100%;
    }

    .price-control {
        flex-basis: calc(33.333% - 10px);
    }
}

@media (max-width: 768px) {
    .collection-controls {
        overflow-x: auto;
    }

    .product-meta {
        flex-direction: column;
        gap: 5px;
    }

    .collection-products-grid {
        gap: 15px;
    }

    .product-card {
        padding: 15px;
        gap: 15px;
    }

    .variant-control-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .variant-nav-buttons {
        width: 100%;
    }

    .btn-nav-small {
        flex: 1;
    }

    .price-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .price-label {
        flex: 0 0 auto;
        min-width: 100px;
    }

    .price-display,
    .new-price-display,
    .discount-input {
        flex: 1;
        min-width: 100px;
    }

    .variant-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .price-control {
        flex-basis: 100%;
        width: 100%;
    }

    .price-input {
        width: 100%;
    }
}
