/* css/card-detail.css */
/* Modal de détail carte style Cardmarket avec glassmorphism */

/* ═══════════════════════════════════════════════════════════════
   MODAL CONTAINER
   ═══════════════════════════════════════════════════════════════ */

.card-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.card-detail-modal.show {
    opacity: 1;
    visibility: visible;
}

.cdm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cdm-container {
    position: relative;
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.card-detail-modal.show .cdm-container {
    transform: scale(1) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   CLOSE BUTTON
   ═══════════════════════════════════════════════════════════════ */

.cdm-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cdm-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.cdm-close svg {
    color: #495057;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.cdm-content {
    display: flex;
    max-height: 90vh;
    overflow: hidden;
}

/* Section gauche - Image */
.cdm-left {
    flex: 0 0 350px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.cdm-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.cdm-image {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.cdm-image:hover {
    transform: scale(1.02);
}

.cdm-owned-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.cdm-inventory-info {
    margin-top: 20px;
    text-align: center;
}

.cdm-copies {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Section droite - Infos */
.cdm-right {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

.cdm-header {
    margin-bottom: 24px;
}

.cdm-series-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.cdm-series-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.cdm-series-badge span {
    font-size: 13px;
    color: #667eea;
    font-weight: 500;
}

.cdm-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.2;
}

.cdm-subtitle {
    font-size: 16px;
    color: #6c757d;
    margin: 4px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   CARD INFO GRID
   ═══════════════════════════════════════════════════════════════ */

.cdm-card-info {
    margin-bottom: 24px;
}

.cdm-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.cdm-info-item {
    background: rgba(0, 0, 0, 0.03);
    padding: 12px;
    border-radius: 12px;
}

.cdm-info-label {
    display: block;
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cdm-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.cdm-rarity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   PRICE SECTION
   ═══════════════════════════════════════════════════════════════ */

.cdm-price-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.cdm-no-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: #6c757d;
}

.cdm-price-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cdm-price-current {
    display: flex;
    flex-direction: column;
}

.cdm-price-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cdm-price-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1;
}

.cdm-price-changes {
    display: flex;
    gap: 12px;
}

.cdm-price-change {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.cdm-price-change.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.cdm-price-change.negative {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.cdm-price-change .change-icon {
    font-size: 16px;
}

.cdm-price-change .change-period {
    font-size: 10px;
    opacity: 0.7;
}

.cdm-price-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cdm-price-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cdm-price-column-header {
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    text-align: center;
    margin-bottom: 2px;
}

.cdm-price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 12px;
}

.cdm-price-row span:first-child {
    color: #6c757d;
}

.cdm-price-row span:last-child {
    font-weight: 600;
    color: #1a1a2e;
}

.cdm-price-source {
    margin-top: 12px;
    text-align: center;
}

.cdm-price-source small {
    color: #adb5bd;
    font-size: 11px;
}

/* Prix gradés */
.cdm-graded-prices {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.cdm-graded-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.cdm-graded-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cdm-graded-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 10px;
    min-width: 80px;
}

.cdm-graded-item span:first-child {
    font-size: 11px;
    color: #856404;
    font-weight: 600;
}

.cdm-graded-item span:last-child {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   EBAY SECTION
   ═══════════════════════════════════════════════════════════════ */

.cdm-ebay-section {
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(0, 100, 210, 0.05), rgba(0, 150, 255, 0.02));
    border: 1px solid rgba(0, 100, 210, 0.15);
    border-radius: 12px;
    padding: 16px;
}

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

.cdm-ebay-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdm-ebay-header h3::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%230064d2"><path d="M6.5 3C4 3 2 5 2 7.5S4 12 6.5 12 11 10 11 7.5 9 3 6.5 3zm0 7C5.12 10 4 8.88 4 7.5S5.12 5 6.5 5 9 6.12 9 7.5 7.88 10 6.5 10zM17.5 12c-2.5 0-4.5 2-4.5 4.5s2 4.5 4.5 4.5 4.5-2 4.5-4.5-2-4.5-4.5-4.5zm0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>') no-repeat center;
    background-size: contain;
}

.cdm-ebay-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #0064d2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cdm-ebay-refresh:hover:not(:disabled) {
    background: #0052a3;
    transform: translateY(-1px);
}

.cdm-ebay-refresh:disabled {
    opacity: 0.6;
    cursor: wait;
}

.cdm-ebay-content {
    min-height: 60px;
}

.cdm-ebay-hint,
.cdm-ebay-empty,
.cdm-ebay-error {
    text-align: center;
    color: #6c757d;
    font-size: 13px;
    padding: 20px;
    margin: 0;
}

.cdm-ebay-error {
    color: #dc3545;
}

.cdm-ebay-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #6c757d;
    font-size: 13px;
}

.cdm-ebay-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 100, 210, 0.1);
}

.cdm-ebay-stat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.cdm-ebay-stat .stat-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #0064d2;
}

.cdm-ebay-stat .stat-label {
    display: block;
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    margin-top: 2px;
}

.cdm-ebay-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cdm-ebay-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.cdm-ebay-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cdm-ebay-thumb {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #f8f9fa;
}

.cdm-ebay-info {
    flex: 1;
    min-width: 0;
}

.cdm-ebay-title {
    font-size: 12px;
    font-weight: 500;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.cdm-ebay-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
}

.cdm-ebay-type {
    padding: 2px 6px;
    background: #e8f4fd;
    color: #0064d2;
    border-radius: 4px;
    font-weight: 500;
}

.cdm-ebay-type.auction {
    background: #fff3cd;
    color: #856404;
}

.cdm-ebay-shipping {
    color: #6c757d;
}

.cdm-ebay-shipping.free {
    color: #28a745;
    font-weight: 500;
}

.cdm-ebay-price {
    font-size: 15px;
    font-weight: 700;
    color: #0064d2;
    white-space: nowrap;
}

.cdm-ebay-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 100, 210, 0.1);
    text-align: center;
}

.cdm-ebay-footer small {
    color: #6c757d;
    font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════════
   CHART SECTION
   ═══════════════════════════════════════════════════════════════ */

.cdm-chart-section {
    margin-bottom: 24px;
}

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

.cdm-chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.cdm-period-select {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.cdm-chart-container {
    height: 200px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   ACTIONS
   ═══════════════════════════════════════════════════════════════ */

.cdm-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.cdm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.cdm-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.cdm-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cdm-btn-primary.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.cdm-btn-secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.cdm-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.2);
}

.cdm-btn-outline {
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.5);
    color: #667eea;
}

.cdm-btn-outline:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

/* ═══════════════════════════════════════════════════════════════
   SIMILAR CARDS
   ═══════════════════════════════════════════════════════════════ */

.cdm-similar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px;
}

.cdm-similar-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.cdm-similar-card {
    flex: 0 0 100px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cdm-similar-card:hover {
    transform: scale(1.05);
}

.cdm-similar-card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cdm-similar-info {
    margin-top: 8px;
    text-align: center;
}

.cdm-similar-name {
    display: block;
    font-size: 11px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cdm-similar-price {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING & ERROR STATES
   ═══════════════════════════════════════════════════════════════ */

.cdm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 20px;
}

.cdm-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: cdm-spin 1s linear infinite;
}

.cdm-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cdm-spin 1s linear infinite;
}

@keyframes cdm-spin {
    to { transform: rotate(360deg); }
}

.cdm-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    text-align: center;
}

.cdm-error svg {
    color: #dc3545;
}

.cdm-error h3 {
    margin: 0;
    color: #1a1a2e;
}

.cdm-error p {
    color: #6c757d;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .cdm-content {
        flex-direction: column;
    }

    .cdm-left {
        flex: 0 0 auto;
        padding: 20px;
    }

    .cdm-image-wrapper {
        max-width: 200px;
    }

    .cdm-right {
        max-height: none;
    }

    .cdm-price-main {
        flex-direction: column;
        gap: 16px;
    }

    .cdm-price-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cdm-actions {
        flex-direction: column;
    }

    .cdm-btn {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .cdm-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .cdm-left {
        padding: 15px;
    }

    .cdm-right {
        padding: 15px;
    }

    .cdm-title {
        font-size: 22px;
    }

    .cdm-price-value {
        font-size: 26px;
    }

    .cdm-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark mode support supprimé - on garde toujours le fond clair pour la lisibilité */
