/* ============================================
   MOBILE CARD DETAILS MODAL
   Long-press card modal for mobile devices
   ============================================ */

/* Modal overlay - full screen */
.card-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

/* Modal container */
.card-preview-modal {
    width: 95vw;
    max-width: 400px;
    max-height: 90vh;
    background: var(--panel-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal header with close button */
.card-preview-modal-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

/* Override flip button positioning for header (not absolute) */
.card-preview-modal-header .card-flip-btn {
    position: static;
    margin: 0;
}

.card-preview-modal-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-left: auto;
}

.card-preview-modal-close svg {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
}

.card-preview-modal-close:hover,
.card-preview-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Card image section */
.card-preview-modal-image {
    display: flex;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.card-preview-modal-image img {
    max-width: 100%;
    max-height: 40vh;
    border-radius: 4.75%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

/* Scrollable content area */
.card-preview-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Card name */
.card-preview-modal-name-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-preview-modal-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.card-preview-modal-other-face {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0;
}

/* Info section */
.card-preview-modal-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-preview-modal-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Set info */
.card-preview-modal-set {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Prices row */
.card-preview-modal-prices {
    display: flex;
    gap: 12px;
}

.card-preview-price-badge {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-preview-price-badge .price-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.card-preview-price-badge .price-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.card-preview-price-badge.unavailable {
    opacity: 0.5;
}

/* Salt score */
.card-preview-salt-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 2px solid;
    border-radius: 8px;
}

.card-preview-salt-value {
    font-size: 1rem;
    font-weight: 700;
}

.card-preview-salt-label {
    font-size: 0.8rem;
}

.card-preview-salt-badge.unavailable {
    border-color: var(--border-color);
    color: var(--text-muted);
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.03);
}

/* Legality grid */
.card-preview-legalities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.card-preview-legality-badge {
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.card-preview-legality-badge.legal {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.card-preview-legality-badge.banned {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.card-preview-legality-badge.not-legal {
    background: rgba(100, 100, 100, 0.15);
    border: 1px solid rgba(100, 100, 100, 0.4);
}

.card-preview-legality-badge .format-name {
    color: var(--text-color);
    font-weight: 500;
}

.card-preview-legality-badge .status-text {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Context menu view */
/* Context menu view */
.card-preview-context-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}

/* Standalone action button (e.g. Edit Tags) */
.card-preview-context-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: left;
}

.card-preview-context-action:hover,
.card-preview-context-action:active {
    background: rgba(255, 255, 255, 0.1);
}

.card-preview-context-action .action-icon {
    font-size: 1.25rem;
    width: 24px;
    display: flex;
    justify-content: center;
    color: var(--text-muted);
}

/* Collapsible Sections */
.card-preview-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: background 0.2s;
}

.card-preview-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}

.modal-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: block;
}

.card-preview-section-header:hover,
.card-preview-section-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.card-preview-section-header.expanded {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.card-preview-section-header .section-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Submenu container with animation */
.card-preview-submenu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
}

.card-preview-submenu.expanded {
    grid-template-rows: 1fr;
}

.card-preview-submenu-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Submenu items */
.card-preview-submenu-item {
    width: 100%;
    text-align: left;
    padding: 12px 16px 12px 24px;
    /* Indented */
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-preview-submenu-item:last-child {
    border-bottom: none;
}

.card-preview-submenu-item:hover,
.card-preview-submenu-item:active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding-left: 28px;
    /* Slight movement on hover */
}

.card-preview-submenu-item .menu-label {
    flex: 1;
}

/* Grid for +/- buttons */
.card-preview-submenu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-preview-submenu-grid .card-preview-submenu-item {
    border-bottom: none;
    justify-content: center;
    text-align: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.card-preview-submenu-grid .card-preview-submenu-item:hover,
.card-preview-submenu-grid .card-preview-submenu-item:active {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 12px;
    /* No indent shift for grid items */
}

/* Destructive actions */
.card-preview-submenu-item.destructive {
    color: #ef4444;
}

.card-preview-submenu-item.destructive:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Footer */
.card-preview-modal-footer {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

/* Toggle button at bottom */
.card-preview-modal-toggle {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    transition: opacity 0.2s;
}

.card-preview-modal-toggle:hover,
.card-preview-modal-toggle:active {
    opacity: 0.9;
}

/* Removed desktop restriction */