/* css/graded.css - Styles pour les cartes gradées */
/* Style: Glassmorphism (fonds semi-transparents + texte clair) */

/* ═══════════════════════════════════════════════════════════════
   VUE PRINCIPALE
   ═══════════════════════════════════════════════════════════════ */

.graded-view {
    padding: 0;
}

.graded-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.graded-loading p {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Barre de stats */
.graded-stats-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.graded-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.graded-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.graded-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-graded {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border: none !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.btn-add-graded:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* ═══════════════════════════════════════════════════════════════
   GRILLE DE CARTES
   ═══════════════════════════════════════════════════════════════ */

.graded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    padding: 20px;
    max-height: 900px;
    overflow-y: auto;
    align-content: start;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar */
.graded-grid::-webkit-scrollbar {
    width: 8px;
}

.graded-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.graded-grid::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.graded-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.graded-card-tile {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.graded-card-tile:hover {
    transform: translateY(-6px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(102, 126, 234, 0.3);
}

.graded-card-image {
    position: relative;
    aspect-ratio: 63 / 88;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.graded-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.graded-card-tile:hover .graded-card-image img {
    transform: scale(1.05);
}

/* Badge de note */
.graded-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    min-width: 45px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.graded-badge .graded-company {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

.graded-badge .graded-grade {
    font-size: 1.1rem;
    font-weight: 800;
}

/* Classes de couleur par note */
.grade-perfect {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%) !important;
    color: #000 !important;
}

.grade-gem {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%) !important;
    color: #fff !important;
}

.grade-mint {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
}

.grade-near-mint {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #000 !important;
}

.grade-excellent {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
    color: #000 !important;
}

.grade-good {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%) !important;
    color: #fff !important;
}

/* Infos de la carte */
.graded-card-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.graded-card-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.graded-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.graded-cert {
    opacity: 0.7;
    color: rgba(255, 255, 255, 0.5);
}

.graded-value {
    font-weight: 600;
    color: #10b981;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.graded-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.graded-modal-content {
    position: relative;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #e0e6ed;
}

.graded-modal-form {
    max-width: 600px;
}

.graded-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
}

.graded-modal-header h4 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.graded-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.graded-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.graded-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Custom scrollbar for modal */
.graded-modal-body::-webkit-scrollbar {
    width: 8px;
}

.graded-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.graded-modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.graded-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

.graded-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.graded-modal-footer .btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.graded-modal-footer .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.graded-modal-footer .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.graded-modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.graded-modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.graded-modal-footer .btn-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.graded-modal-footer .btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

/* ═══════════════════════════════════════════════════════════════
   FORMULAIRES
   ═══════════════════════════════════════════════════════════════ */

.graded-modal-body .form-group {
    position: relative;
    margin-bottom: 1rem;
}

.graded-modal-body .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.graded-modal-body .form-group input,
.graded-modal-body .form-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.graded-modal-body .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.graded-modal-body .form-group input:focus,
.graded-modal-body .form-group select:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    outline: none;
}

.graded-modal-body .form-group select option {
    background: #1a1a2e;
    color: #fff;
}

.graded-modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   DÉTAIL CARTE GRADÉE
   ═══════════════════════════════════════════════════════════════ */

.graded-detail-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

@media (max-width: 576px) {
    .graded-detail-layout {
        grid-template-columns: 1fr;
    }
}

.graded-detail-image {
    position: relative;
}

.graded-detail-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.graded-badge-large {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 55px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.graded-badge-large .graded-company {
    font-size: 0.75rem;
    font-weight: 600;
}

.graded-badge-large .graded-grade {
    font-size: 1.5rem;
    font-weight: 800;
}

.graded-detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.graded-info-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.graded-info-group label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
    margin: 0;
}

.graded-info-group span,
.graded-info-group p {
    color: #fff;
    margin: 0;
}

.graded-value-large {
    font-size: 1.25rem;
    font-weight: 700;
    color: #10b981 !important;
}

/* Sous-notes */
.graded-subgrades {
    margin-top: 0.5rem;
}

.graded-subgrades h6 {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.subgrades-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.subgrade-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    min-width: 60px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.subgrade-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: capitalize;
}

.subgrade-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.graded-financials {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   PRIX DU MARCHÉ
   ═══════════════════════════════════════════════════════════════ */

.graded-market-prices {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.graded-market-prices h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.75rem 0;
}

.graded-loading-prices {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.graded-loading-prices .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.graded-no-prices {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.graded-raw-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.75rem;
}

.graded-raw-price .price-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.graded-raw-price .price-value {
    color: #fff;
    font-weight: 600;
}

.graded-company-prices {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.graded-company-prices .company-label {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 40px;
}

.graded-company-prices .company-grades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.graded-company-prices .grade-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 55px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.graded-company-prices .grade-price:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.graded-company-prices .grade-price.user-grade {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.graded-company-prices .grade-price .grade {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.graded-company-prices .grade-price .price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
}

.graded-company-prices .grade-price.user-grade .price {
    color: #a8b8ff;
}

.prices-updated {
    text-align: right;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.prices-updated small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════════
   RECHERCHE DE CARTE
   ═══════════════════════════════════════════════════════════════ */

.graded-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 35, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.graded-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.graded-search-item:last-child {
    border-bottom: none;
}

.graded-search-item:hover {
    background: rgba(102, 126, 234, 0.2);
}

.graded-search-item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.graded-search-item-info {
    flex: 1;
    min-width: 0;
}

.graded-search-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.graded-search-item-set {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.graded-search-empty {
    padding: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Carte sélectionnée */
.graded-selected-card {
    margin-top: 0.5rem;
}

.graded-selected-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.graded-selected-info img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
}

.graded-selected-info span {
    flex: 1;
    color: #fff;
    font-weight: 500;
}

.graded-selected-info .btn {
    margin-left: auto;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.graded-selected-info .btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */

.graded-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.graded-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.graded-empty h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.graded-empty p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 300px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .graded-stats-bar {
        gap: 1rem;
        padding: 0.75rem 1rem;
    }

    .graded-stat-value {
        font-size: 1.25rem;
    }

    .graded-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
        padding: 12px;
    }

    .graded-modal-content {
        max-height: 95vh;
        border-radius: 16px;
    }

    .graded-modal-body .form-row {
        grid-template-columns: 1fr;
    }

    .graded-detail-layout {
        grid-template-columns: 1fr;
    }

    .graded-detail-image {
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .graded-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .graded-stats-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .graded-stat {
        flex-direction: row;
        justify-content: space-between;
    }

    .btn-add-graded {
        margin-left: 0;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PSA QUICK ADD MODAL
   ═══════════════════════════════════════════════════════════════ */

/* PSA Cert Card */
.psa-cert-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
}

.psa-cert-layout {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.psa-slab-image {
    flex-shrink: 0;
}

.psa-slab-image img {
    width: 100px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.psa-cert-info-content {
    flex: 1;
    min-width: 0;
}

.psa-cert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.psa-grade-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

/* Badges par grade */
.psa-grade-10 {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%) !important;
    color: #000 !important;
}

.psa-grade-9 {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%) !important;
    color: #fff !important;
}

.psa-grade-8 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
}

.psa-grade-7 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: #000 !important;
}

.psa-cert-number {
    font-family: monospace;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.psa-cert-details {
    color: #fff;
}

.psa-cert-details strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
}

/* Match items */
.psa-match-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.psa-match-item.selected {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
}

.psa-match-item img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.psa-match-info {
    flex: 1;
    min-width: 0;
}

.psa-match-info strong {
    display: block;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psa-match-info small {
    color: rgba(255, 255, 255, 0.5);
}

/* Other matches */
.psa-other-matches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.psa-other-match {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.psa-other-match:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.psa-other-match img {
    width: 24px;
    height: 34px;
    object-fit: cover;
    border-radius: 3px;
}

/* Button group dans stats bar */
.graded-stats-bar .btn-group {
    margin-left: auto;
    display: flex;
    gap: 0;
}

.graded-stats-bar .btn-group .btn {
    border-radius: 0;
    padding: 10px 16px;
}

.graded-stats-bar .btn-group .btn:first-child {
    border-radius: 12px 0 0 12px;
}

.graded-stats-bar .btn-group .btn:last-child {
    border-radius: 0 12px 12px 0;
}

.graded-stats-bar .btn-group .btn-outline-primary {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #a8b8ff;
}

.graded-stats-bar .btn-group .btn-outline-primary:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.6);
}

/* Toast notifications pour PSA - Scopées à graded-view */
/* Note: Les toasts globaux utilisent les styles inline de ui.js */

/* Slab image container avec bouton flip */
.slab-image-container {
    position: relative;
    display: inline-block;
}

.slab-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.slab-flip-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.slab-flip-btn:hover {
    background: rgba(102, 126, 234, 0.8);
    border-color: rgba(102, 126, 234, 0.6);
}

/* Responsive pour btn-group */
@media (max-width: 480px) {
    .graded-stats-bar .btn-group {
        width: 100%;
        margin-left: 0;
    }

    .graded-stats-bar .btn-group .btn {
        flex: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   NOUVEAU MODAL CARTE GRADÉE (v2)
   ═══════════════════════════════════════════════════════════════ */

.gd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    overflow-y: auto;
}

.gd-modal-container {
    position: relative;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    background: linear-gradient(135deg, rgba(15, 20, 45, 0.98), rgba(10, 14, 39, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 255, 255, 0.05);
}

.gd-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.gd-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

/* Colonne gauche - Image */
.gd-modal-left {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-image-wrapper {
    position: relative;
    width: 100%;
}

.gd-image-wrapper img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gd-flip-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.gd-flip-btn:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* Badge grade */
.gd-grade-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border-radius: 12px;
    min-width: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.gd-grade-badge.grade-10 {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.gd-grade-badge.grade-9 {
    background: linear-gradient(135deg, #00d4aa, #00b894);
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
}

.gd-grade-company {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
}

.gd-grade-badge.grade-10 .gd-grade-company,
.gd-grade-badge.grade-10 .gd-grade-value {
    color: #1a1a1a;
}

.gd-grade-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

/* Sous-notes */
.gd-subgrades {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.gd-subgrade-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-subgrade-label {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.gd-subgrade-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

/* Colonne droite - Infos */
.gd-modal-right {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gd-modal-right::-webkit-scrollbar {
    width: 6px;
}

.gd-modal-right::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.gd-modal-right::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

/* Header */
.gd-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-set-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #a8b8ff;
    margin-bottom: 0.5rem;
}

.gd-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grille d'infos */
.gd-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.gd-info-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.75rem;
}

.gd-info-label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.gd-info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.gd-rarity {
    color: #fbbf24 !important;
}

/* Lien vérification */
.gd-verify-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    color: #34d399;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gd-verify-link:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

/* Sections */
.gd-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
}

.gd-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.gd-section-icon {
    font-size: 1rem;
}

.gd-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.gd-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.gd-no-data {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}

/* Section Financière */
.gd-finance-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(102, 126, 234, 0.08));
    border-color: rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gd-finance-main {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gd-finance-item {
    display: flex;
    flex-direction: column;
}

.gd-finance-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gd-finance-value {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.gd-value-big {
    font-size: 1.25rem;
    color: #10b981 !important;
}

.gd-profit-positive {
    color: #10b981 !important;
}

.gd-profit-negative {
    color: #ef4444 !important;
}

.gd-profit-badge {
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.gd-profit-badge.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.gd-profit-badge.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Prix du marché */
.gd-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gd-price-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.gd-price-value {
    font-weight: 600;
    color: #fff;
}

.gd-graded-prices {
    margin-top: 0.5rem;
}

.gd-company-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.gd-company-name {
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 35px;
}

.gd-grades-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gd-grade-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 50px;
}

.gd-grade-chip.gd-user-grade {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.gd-grade-num {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.gd-grade-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.gd-updated-date {
    text-align: right;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

/* Population PSA */
.gd-pop-total {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.gd-pop-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gd-pop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.gd-pop-row.gd-user-grade {
    background: rgba(102, 126, 234, 0.15);
}

.gd-pop-grade {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 55px;
}

.gd-pop-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.gd-pop-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gd-pop-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 50px;
    text-align: right;
}

.gd-pop-lower {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gd-pop-chip {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Ventes eBay */
.gd-sales-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.gd-sales-user-grade {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.gd-sales-grade-header {
    font-weight: 700;
    color: #a8b8ff;
    margin-bottom: 0.5rem;
}

.gd-sales-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.gd-sales-stat {
    text-align: center;
}

.gd-stat-label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.gd-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.gd-recent-sales {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gd-sale-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.8rem;
}

.gd-sale-item.gd-user-grade {
    background: rgba(102, 126, 234, 0.1);
}

.gd-sale-grade {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    min-width: 50px;
}

.gd-sale-price {
    font-weight: 700;
    color: #10b981;
    min-width: 60px;
}

.gd-sale-date {
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

/* Notes */
.gd-notes-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Actions */
.gd-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.gd-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.gd-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.gd-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.gd-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.gd-btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .gd-modal-container {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }

    .gd-modal-left {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .gd-image-wrapper {
        width: 150px;
    }

    .gd-modal-right {
        max-height: none;
    }

    .gd-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gd-sales-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gd-modal-overlay {
        padding: 0.5rem;
    }

    .gd-info-grid {
        grid-template-columns: 1fr;
    }

    .gd-finance-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .gd-modal-actions {
        flex-direction: column;
    }

    .gd-btn {
        width: 100%;
    }
}
