/**
 * Card Details Modal - Standalone Component Styles
 * This modal uses unique class names and does not inherit from universal modal styles
 * All classes prefixed with .cardModal- to avoid conflicts
 */

/* Accessibility - Visually Hidden but Screen Reader Accessible */
.cardModal-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Modal Overlay */
.cardModal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-deck-modal-stacked) !important; /* Above deck modal */
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto; /* Re-enable pointer events for the modal itself */
}

.cardModal-overlay.cardModal-active {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.cardModal-container {
    background: var(--card-bg, white);
    border-radius: 20px;
    width: 80vw;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cardModal-overlay.cardModal-active .cardModal-container {
    transform: scale(1);
}

/* Close Button */
.cardModal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary, #333);
    transition: all 0.2s ease;
    z-index: 200; /* Above sticky header (100) and all modal content */
}

.cardModal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.cardModal-close:active {
    transform: scale(0.95);
}

/* Scroll Container - Enables scrolling through sections */
.cardModal-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Scroll Container */
.cardModal-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.cardModal-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.cardModal-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.cardModal-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Hero Section - Initial Large Card View */
.cardModal-hero-section {
    height: 93vh;
    min-height: 93vh;
    max-height: 93vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;  /* Space between image and indicator */
    padding: 60px 40px 40px;
    position: relative;
    gap: 20px;  /* Add gap between image and indicator */
    z-index: 1;
}

.cardModal-hero-image-wrapper {
    width: 100%;
    max-width: 550px;
    height: 100%;
    max-height: calc(90vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;  /* Prevent shrinking */
}

.cardModal-hero-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

/* Scroll Indicator - Compact inline design */
.cardModal-scroll-indicator {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary, #6e6e73);
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    padding: 10px;
    width: 100%;
    flex-shrink: 0;
}

.cardModal-scroll-text {
    text-transform: lowercase;
    letter-spacing: 0.5px;
}

.cardModal-scroll-arrow {
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    animation: cardModal-arrow-bounce 1.5s ease-in-out infinite;
}

@keyframes cardModal-arrow-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

/* Modal Content - Two Column Layout (appears after scrolling) */
.cardModal-content {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    padding: 40px;
    background: var(--card-bg, white);
}

/* Left Column - Sticky Card Image */
.cardModal-image-section {
    position: sticky;
    top: 40px;
    align-self: flex-start;
    max-width: 400px;
}

.cardModal-card-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

/* Right Column - Scrollable Card Details */
.cardModal-details-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Sticky Header in Details Section - sticks to top of scroll container */
.cardModal-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    margin: 0 0 24px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cardModal-card-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #1d1d1f);
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.cardModal-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cardModal-meta-badge {
    padding: 4px 10px;
    background: #f5f5f7;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #6e6e73;
}

/* Type badge with card color backgrounds */
.cardModal-meta-badge.cardModal-type-Red { background-color: #e74c3c; color: white; }
.cardModal-meta-badge.cardModal-type-Blue { background-color: #3498db; color: white; }
.cardModal-meta-badge.cardModal-type-Green { background-color: #27ae60; color: white; }
.cardModal-meta-badge.cardModal-type-Yellow { background-color: #f1c40f; color: #333; }
.cardModal-meta-badge.cardModal-type-Purple { background-color: #9b59b6; color: white; }
.cardModal-meta-badge.cardModal-type-White { background-color: #ecf0f1; color: #333; }
.cardModal-meta-badge.cardModal-type-Black { background-color: #2c3e50; color: white; }

/* Rarity badges */
.cardModal-meta-badge.cardModal-rarity-C { background-color: #7f8c8d; color: white; }
.cardModal-meta-badge.cardModal-rarity-U { background-color: #16a085; color: white; }
.cardModal-meta-badge.cardModal-rarity-R { background-color: #2980b9; color: white; }
.cardModal-meta-badge.cardModal-rarity-RR { background-color: #8e44ad; color: white; }
.cardModal-meta-badge.cardModal-rarity-SR { background-color: #d35400; color: white; }
.cardModal-meta-badge.cardModal-rarity-UR { background-color: #c0392b; color: white; }
.cardModal-meta-badge.cardModal-rarity-LR { background-color: #34495e; color: white; }
.cardModal-meta-badge.cardModal-rarity-P { background-color: #e67e22; color: white; }

/* Scrollable Content Area */
.cardModal-scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

/* Custom Scrollbar */
.cardModal-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.cardModal-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.cardModal-scrollable-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.cardModal-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Stats Grid - Now in left column under card image */
.cardModal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.cardModal-stat-item {
    background: #f5f5f7;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.cardModal-stat-label {
    font-size: 12px;
    color: #6e6e73;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.cardModal-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1d1d1f);
}

/* TCGPlayer Price Section */
.cardModal-price-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    border-radius: 16px;
    color: white;
    margin-bottom: 32px;
}

.cardModal-price-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.cardModal-price-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cardModal-price-button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
    text-decoration: none;
    display: block;
    text-align: center;
}

.cardModal-price-button:hover {
    transform: scale(1.02);
}

/* Content Sections */
.cardModal-section {
    margin-bottom: 32px;
}

.cardModal-section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #1d1d1f);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid var(--color-primary, #3498db);
}

.cardModal-section-content {
    font-size: 15px;
    line-height: 1.6;
    color: #515154;
}

/* Sections in left column - smaller spacing */
.cardModal-image-section .cardModal-section {
    margin-bottom: 20px;
}

.cardModal-image-section .cardModal-section-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.cardModal-image-section .cardModal-section-content {
    font-size: 14px;
}

/* Traits & Link Pills */
.cardModal-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cardModal-pill {
    padding: 8px 16px;
    background: #e8e8ed;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #1d1d1f);
}

/* Linkable Cards Section */
.cardModal-linkable-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cardModal-link-card-wrapper {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.cardModal-link-card {
    background: #f5f5f7;
    border: 2px solid #e0e0e5;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.cardModal-link-card:hover {
    background: #e8e8ed;
}

.cardModal-link-card.expanded {
    background: #e0e0e5;
}

.cardModal-link-card-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.cardModal-link-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #1d1d1f);
    flex: 1;
    min-width: 0;
}

.cardModal-link-card-number {
    font-size: 13px;
    font-weight: 500;
    color: #6e6e73;
    white-space: nowrap;
}

.cardModal-link-card-add {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.cardModal-link-card-add svg {
    width: 18px;
    height: 18px;
}

.cardModal-link-card-add:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #00aadd 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.5);
}

.cardModal-link-card-add:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 212, 255, 0.3);
}

/* Expandable Drawer */
.cardModal-link-card-drawer {
    background: #f9f9fb;
    border-top: 1px solid #e0e0e5;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cardModal-link-card-drawer.show {
    padding: 16px;
    max-height: 500px;
}

.cardModal-link-card-description {
    font-size: 13px;
    line-height: 1.6;
    color: #6e6e73;
    white-space: pre-wrap;
}

/* Market Price Section - Design 2: Minimal Split */
.cardModal-price-container {
    border: 2px solid #e8e8ed;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cardModal-price-left {
    flex: 1;
}

.cardModal-price-main {
    font-size: 24px;
    font-weight: 700;
    color: #0066cc;
    margin-bottom: 4px;
}

.cardModal-price-sub {
    font-size: 11px;
    color: #6e6e73;
}

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

.cardModal-price-button {
    padding: 8px 16px;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap;
}

.cardModal-price-button:hover {
    background: #0052a3;
}

/* Navigation Buttons */
.cardModal-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    color: #1d1d1f;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    z-index: 200; /* Above sticky header (100) and all modal content */
    user-select: none;
}

.cardModal-overlay.cardModal-active .cardModal-nav-btn {
    opacity: 0.7;
}

.cardModal-overlay.cardModal-active .cardModal-nav-btn:hover {
    opacity: 1;
    background: white;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.cardModal-nav-btn:active {
    transform: translateY(-50%) scale(1.05);
}

.cardModal-nav-btn-prev {
    left: 20px;
}

.cardModal-nav-btn-next {
    right: 20px;
}

.cardModal-nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.cardModal-nav-btn:disabled:hover {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Dark theme support handled automatically via CSS variables from themes.css */

/* Responsive Design */
@media (max-width: 768px) {
    .cardModal-container {
        width: 95vw;
        max-width: 100%;
        border-radius: 16px;
    }

    .cardModal-hero-section {
        height: 85vh;
        min-height: 85vh;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 60px 20px 30px;
        gap: 15px;
    }

    .cardModal-hero-image-wrapper {
        max-width: 320px;
        max-height: calc(90vh - 180px);
        flex-shrink: 0;
    }

    .cardModal-scroll-indicator {
        padding: 8px;
        font-size: 12px;
    }

    .cardModal-scroll-arrow {
        font-size: 14px;
    }

    .cardModal-content {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 30px 20px;
    }

    .cardModal-image-section {
        position: relative;
        top: 0;
        max-width: 300px;
        margin: 0 auto;
    }

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

    .cardModal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .cardModal-nav-btn-prev {
        left: 10px;
    }

    .cardModal-nav-btn-next {
        right: 10px;
    }

    .cardModal-close {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .cardModal-container {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .cardModal-hero-section {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 60px 15px 30px;
        gap: 10px;
    }

    .cardModal-hero-image-wrapper {
        max-width: 85%;
        max-height: calc(100vh - 150px);
        flex-shrink: 0;
    }

    .cardModal-scroll-indicator {
        padding: 6px;
        font-size: 11px;
        gap: 8px;
    }

    .cardModal-scroll-arrow {
        font-size: 12px;
    }

    .cardModal-content {
        padding: 30px 15px 20px;
        gap: 20px;
    }

    .cardModal-image-section {
        max-width: 100%;
    }

    .cardModal-card-image {
        border-radius: 12px;
    }

    .cardModal-hero-image {
        border-radius: 12px;
    }

    .cardModal-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .cardModal-header {
        padding: 12px 16px;
    }

    .cardModal-card-name {
        font-size: 18px;
    }
}

/* Animation for modal entry */
@keyframes cardModal-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cardModal-overlay.cardModal-active .cardModal-card-image-wrapper {
    animation: cardModal-fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading state for images */
.cardModal-card-image[src=""] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cardModal-card-image[src=""]::after {
    content: "Loading...";
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* Admin Section Styles */
.cardModal-admin-section {
    position: relative; /* Ensure normal document flow */
    background: var(--surface-tertiary, rgba(255, 249, 230, 0.1));
    border: 2px solid var(--admin-border, rgba(255, 215, 0, 0.5));
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    z-index: 1; /* Stay below navigation and close button */
}

.cardModal-admin-title {
    color: var(--admin-title, #ffd700);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
}

.cardModal-admin-title::before {
    content: "🔧";
    font-size: 20px;
}

.cardModal-admin-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cardModal-admin-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--card-bg, rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    gap: 16px;
}

.cardModal-admin-label {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    font-size: 14px;
    min-width: 100px;
    flex-shrink: 0;
}

.cardModal-admin-value {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary, #ffffff);
    padding: 6px 12px;
    background: var(--surface-tertiary, rgba(0, 0, 0, 0.2));
    border-radius: 6px;
    min-width: 100px;
    text-align: center;
    flex: 1;
}

/* Editable field styling */
.cardModal-admin-editable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cardModal-admin-editable:hover {
    background: var(--button-hover-bg, rgba(255, 255, 255, 0.15));
    box-shadow: 0 0 0 2px var(--focus-color, rgba(100, 150, 255, 0.3));
}

.cardModal-admin-editable:hover::after {
    content: "Click to edit";
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

/* Admin input styles for inline editing */
.cardModal-admin-input {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    padding: 6px 12px;
    border: 2px solid var(--focus-color, #0066cc);
    border-radius: 6px;
    min-width: 120px;
    text-align: center;
    outline: none;
    background: var(--input-bg, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #ffffff);
}

.cardModal-admin-input:focus {
    border-color: var(--focus-color, #0066cc);
    box-shadow: 0 0 0 3px var(--focus-shadow, rgba(0, 102, 204, 0.2));
}

.cardModal-admin-save-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cardModal-admin-save-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.cardModal-admin-cancel-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cardModal-admin-cancel-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* ========================================================================
   Admin Labels Section
   ======================================================================== */

.cardModal-admin-labels {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.cardModal-admin-labels-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cardModal-admin-labels-current {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 32px;
    align-items: center;
}

.cardModal-admin-labels-empty {
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    font-style: italic;
}

.cardModal-admin-label-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--button-primary-bg, rgba(100, 150, 255, 0.2));
    color: var(--button-primary-text, #6696ff);
    border: 1px solid var(--button-primary-border, rgba(100, 150, 255, 0.3));
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cardModal-admin-label-badge:hover {
    background: var(--button-primary-hover-bg, rgba(100, 150, 255, 0.3));
    border-color: var(--button-primary-hover-border, rgba(100, 150, 255, 0.5));
}

.cardModal-admin-label-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.cardModal-admin-label-remove:hover {
    opacity: 1;
}

.cardModal-admin-labels-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.cardModal-admin-labels-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, #ffffff);
    outline: none;
    transition: all 0.2s ease;
}

.cardModal-admin-labels-input:focus {
    border-color: var(--focus-color, #6696ff);
    background: var(--input-focus-bg, rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 0 2px var(--focus-shadow, rgba(102, 150, 255, 0.2));
}

.cardModal-admin-labels-input::placeholder {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
}

.cardModal-admin-labels-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--button-success-bg, #28a745);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cardModal-admin-labels-add-btn:hover:not(:disabled) {
    background: var(--button-success-hover-bg, #218838);
    transform: scale(1.05);
}

.cardModal-admin-labels-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cardModal-admin-labels-suggestions {
    margin-top: 8px;
    background: var(--dropdown-bg, rgba(40, 40, 40, 0.95));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.2));
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cardModal-admin-label-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.cardModal-admin-label-suggestion:hover {
    background: var(--dropdown-hover-bg, rgba(100, 150, 255, 0.2));
}

.cardModal-admin-label-suggestion-name {
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.cardModal-admin-label-suggestion-count {
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    background: var(--badge-bg, rgba(255, 255, 255, 0.1));
    padding: 2px 6px;
    border-radius: 10px;
}

/* ============================================================================
   ADMIN EFFECTS SECTION (Mirrored from Labels)
   ============================================================================ */

.cardModal-admin-effects {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
}

.cardModal-admin-effects-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cardModal-admin-effects-current {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 32px;
    align-items: center;
}

.cardModal-admin-effects-empty {
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    font-style: italic;
}

.cardModal-admin-effect-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--button-primary-bg, rgba(100, 150, 255, 0.2));
    color: var(--button-primary-text, #6696ff);
    border: 1px solid var(--button-primary-border, rgba(100, 150, 255, 0.3));
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cardModal-admin-effect-badge.active {
    background: var(--button-primary-bg, rgba(100, 150, 255, 0.2));
    color: var(--button-primary-text, #6696ff);
    border-color: var(--button-primary-border, rgba(100, 150, 255, 0.3));
}

.cardModal-admin-effect-badge.inactive {
    background: var(--button-disabled-bg, rgba(128, 128, 128, 0.1));
    color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
    border-color: var(--border-secondary, rgba(255, 255, 255, 0.1));
    opacity: 0.6;
}

.cardModal-admin-effect-badge:hover {
    background: var(--button-primary-hover-bg, rgba(100, 150, 255, 0.3));
    border-color: var(--button-primary-hover-border, rgba(100, 150, 255, 0.5));
}

.cardModal-admin-effect-badge.inactive:hover {
    background: var(--button-disabled-hover-bg, rgba(128, 128, 128, 0.15));
    opacity: 0.8;
}

/* Source icon (auto-scraped vs manual) */
.cardModal-admin-effect-source {
    font-size: 14px;
    line-height: 1;
    cursor: help;
}

/* Effect name */
.cardModal-admin-effect-name {
    flex: 1;
}

/* Toggle button (●/○) */
.cardModal-admin-effect-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    color: inherit;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.cardModal-admin-effect-toggle:hover {
    opacity: 1;
    transform: scale(1.2);
}

.cardModal-admin-effect-badge.active .cardModal-admin-effect-toggle {
    color: #28a745; /* Green for active */
}

.cardModal-admin-effect-badge.inactive .cardModal-admin-effect-toggle {
    color: #6c757d; /* Gray for inactive */
}

/* Remove button (×) */
.cardModal-admin-effect-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.cardModal-admin-effect-remove:hover {
    opacity: 1;
    color: #dc3545; /* Red on hover */
}

.cardModal-admin-effects-add {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.cardModal-admin-effects-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.2));
    border-radius: 6px;
    background: var(--input-bg, rgba(255, 255, 255, 0.05));
    color: var(--text-primary, #ffffff);
    outline: none;
    transition: all 0.2s ease;
}

.cardModal-admin-effects-input:focus {
    border-color: var(--focus-color, #6696ff);
    background: var(--input-focus-bg, rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 0 2px var(--focus-shadow, rgba(102, 150, 255, 0.2));
}

.cardModal-admin-effects-input::placeholder {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
}

.cardModal-admin-effects-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--button-success-bg, #28a745);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cardModal-admin-effects-add-btn:hover:not(:disabled) {
    background: var(--button-success-hover-bg, #218838);
    transform: scale(1.05);
}

.cardModal-admin-effects-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cardModal-admin-effects-suggestions {
    margin-top: 8px;
    background: var(--dropdown-bg, rgba(40, 40, 40, 0.95));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.2));
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cardModal-admin-effect-suggestion {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.cardModal-admin-effect-suggestion:hover {
    background: var(--dropdown-hover-bg, rgba(100, 150, 255, 0.2));
}

.cardModal-admin-effect-suggestion-name {
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.cardModal-admin-effect-suggestion-count {
    font-size: 11px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    background: var(--badge-bg, rgba(255, 255, 255, 0.1));
    padding: 2px 6px;
    border-radius: 10px;
}

/* Left Column Sections - Where To Get & Collection */
.left-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--modal-card-bg, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    border: 1px solid var(--modal-border, rgba(255, 255, 255, 0.1));
}

.left-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--modal-text-primary, #ffffff);
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.left-section-content {
    font-size: 13px;
    color: var(--modal-text-secondary, rgba(255, 255, 255, 0.8));
    line-height: 1.5;
}

.left-collection-quantities {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.left-quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--modal-bg, rgba(0, 0, 0, 0.3));
    border-radius: 8px;
}

.left-quantity-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--modal-text-secondary, rgba(255, 255, 255, 0.7));
}

.left-quantity-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--modal-text-primary, #ffffff);
    min-width: 30px;
    text-align: right;
}

/* Collection Quantities in Left Column */
.cardModal-collection-quantities {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cardModal-quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface-tertiary, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
}

.cardModal-quantity-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.cardModal-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cardModal-quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.2));
    background: var(--button-secondary-bg, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #ffffff);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.cardModal-quantity-btn:hover {
    background: var(--button-hover-bg, rgba(255, 255, 255, 0.2));
    border-color: var(--border-hover-color, rgba(255, 255, 255, 0.3));
    transform: scale(1.05);
}

.cardModal-quantity-btn:active {
    transform: scale(0.95);
}

.cardModal-quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.cardModal-quantity-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    min-width: 30px;
    text-align: center;
}

/* Graded Card Row */
.cardModal-graded-row {
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.1));
}

.cardModal-graded-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cardModal-add-graded-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--color-primary, #3b82f6);
    background: transparent;
    color: var(--color-primary, #3b82f6);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cardModal-add-graded-btn:hover {
    background: var(--color-primary, #3b82f6);
    color: white;
}

.cardModal-add-graded-btn:active {
    transform: scale(0.95);
}

/* ===================================
   Deck Builder Add Button
   =================================== */

.cardModal-add-to-deck-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cardModal-add-to-deck-btn:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #00aadd 100%);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.cardModal-add-to-deck-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.cardModal-add-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===================================
   Create Label/Effect Forms
   =================================== */

.cardModal-admin-create-link {
    margin-top: 12px;
    text-align: center;
}

.cardModal-admin-create-link a {
    color: var(--button-primary-text, #6696ff);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.cardModal-admin-create-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

.cardModal-admin-create-form {
    margin-top: 16px;
    padding: 16px;
    background: var(--card-background, rgba(30, 30, 50, 0.6));
    border: 1px solid var(--border-primary, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
}

.cardModal-admin-create-form h4 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
}

.cardModal-admin-form-field {
    margin-bottom: 12px;
}

.cardModal-admin-form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.cardModal-admin-form-field input,
.cardModal-admin-form-field textarea,
.cardModal-admin-form-field select {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-background, rgba(20, 20, 30, 0.6));
    border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    color: var(--text-primary, rgba(255, 255, 255, 0.9));
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.cardModal-admin-form-field input:focus,
.cardModal-admin-form-field textarea:focus,
.cardModal-admin-form-field select:focus {
    outline: none;
    border-color: var(--button-primary-border, rgba(100, 150, 255, 0.5));
}

.cardModal-admin-form-field textarea {
    min-height: 60px;
    resize: vertical;
}

.cardModal-admin-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.cardModal-admin-form-submit,
.cardModal-admin-form-cancel {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cardModal-admin-form-submit {
    background: var(--button-primary-bg, rgba(100, 150, 255, 0.2));
    color: var(--button-primary-text, #6696ff);
    border: 1px solid var(--button-primary-border, rgba(100, 150, 255, 0.3));
}

.cardModal-admin-form-submit:hover {
    background: var(--button-primary-hover-bg, rgba(100, 150, 255, 0.3));
}

.cardModal-admin-form-cancel {
    background: var(--button-secondary-bg, rgba(128, 128, 128, 0.1));
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    border: 1px solid var(--border-secondary, rgba(255, 255, 255, 0.1));
}

.cardModal-admin-form-cancel:hover {
    background: var(--button-secondary-hover-bg, rgba(128, 128, 128, 0.2));
}
