/* ===================================
   CSS Custom Properties (Theme Variables)
   =================================== */
:root {
    /* Light mode colors */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --bg-body: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);

    --card-bg: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);

    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --text-on-primary: #ffffff;

    --border-color: #e1e5e9;
    --border-focus: #667eea;

    --input-bg: #ffffff;
    --input-border: #e1e5e9;

    --btn-primary-bg: #667eea;
    --btn-primary-hover: #5568d3;
    --btn-success-bg: #28a745;
    --btn-danger-bg: #dc3545;

    --accent-color: #667eea;
    --accent-light: rgba(102, 126, 234, 0.1);

    --badge-foil-bg: #fff5b8;
    --badge-foil-text: #6b5e00;
    --badge-foil-border: #f0e38a;
    --badge-etched-bg: #e9f0ff;
    --badge-etched-text: #1d3f72;
    --badge-etched-border: #cbd9f3;
}

/* Dark mode colors */
.dark-mode {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --bg-body: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);

    --card-bg: #0f3460;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.4);

    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-light: #888;
    --text-on-primary: #ffffff;

    --border-color: #2a3f5f;
    --border-focus: #a855f7;

    --input-bg: #1a2332;
    --input-border: #2a3f5f;

    --btn-primary-bg: #a855f7;
    --btn-primary-hover: #9333ea;
    --btn-success-bg: #10b981;
    --btn-danger-bg: #ef4444;

    --accent-color: #a855f7;
    --accent-light: rgba(168, 85, 247, 0.1);

    --badge-foil-bg: #fef3c7;
    --badge-foil-text: #78350f;
    --badge-foil-border: #f59e0b;
    --badge-etched-bg: #dbeafe;
    --badge-etched-text: #1e40af;
    --badge-etched-border: #3b82f6;
}

/* Base styles with theme support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Inline badges for card flags */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    line-height: 1;
    border-radius: 6px;
    margin-left: 6px;
}

.badge-foil {
    background: var(--badge-foil-bg);
    color: var(--badge-foil-text);
    border: 1px solid var(--badge-foil-border);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
}

.badge-etched {
    background: var(--badge-etched-bg);
    color: var(--badge-etched-text);
    border: 1px solid var(--badge-etched-border);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.08);
}

.icon {
    width: 14px;
    height: 14px;
    display: block;
}

.icon,
.icon path {
    fill: currentColor;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header with theme toggle */
header {
    margin-bottom: 40px;
    color: var(--text-on-primary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-text {
    flex: 1;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .sun-icon {
    opacity: 1;
}

.theme-toggle .moon-icon {
    opacity: 0;
}

.dark-mode .theme-toggle .sun-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

.dark-mode .theme-toggle .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-group {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.input-group:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.input-group textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--input-bg);
    color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.input-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.input-tab-btn {
    flex: 1;
    padding: 8px 16px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.input-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.input-tab-btn:hover {
    color: #667eea;
}

.input-content {
    display: none;
}

.input-content.active {
    display: block;
}

.url-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.3s ease;
    margin-bottom: 10px;
}

.url-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.load-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.load-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.load-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.input-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.input-options .checkbox-label {
    font-size: 0.9rem;
    color: #666;
}

.options-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.option-group {
    margin-bottom: 15px;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group .checkbox-label {
    display: block;
    margin-bottom: 8px;
}

.option-group .checkbox-label:last-child {
    margin-bottom: 0;
}

.price-provider-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 1rem;
}

.price-provider-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.price-provider-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.price-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    display: inline-block;
}

.price-badge.foil {
    background: #28a745;
    color: white;
}

.price-badge.etched {
    background: #28a745;
    color: white;
}

.price-loading {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    display: inline-block;
}

p.card-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.card-set {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 15px;
}

.card-quantity {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 15px;
}

.price-error {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
    display: inline-block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #667eea;
    border-radius: 3px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    background-color: white;
    display: inline-block;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark {
    background-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked+.checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
}

.search-btn {
    width: 100%;
    padding: 15px 30px;
    background: var(--btn-primary-bg);
    color: var(--text-on-primary);
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    box-shadow: 0 5px 15px var(--accent-light);
}

.search-btn:hover:not(:disabled) {
    background: var(--btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-light);
}

.search-btn:active {
    transform: translateY(0);
}

.feedback-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ff6b6b;
}

.feedback-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.feedback-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.feedback-stat {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    border-radius: 8px;
    border: 1px solid #ffcccc;
}

.feedback-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 5px;
}

.feedback-stat-label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.feedback-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.feedback-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.feedback-tab-btn.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

.feedback-tab-btn:hover {
    color: #ff6b6b;
}

.feedback-content {
    display: none;
}

.feedback-content.active {
    display: block;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
}

.error-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 3px solid var(--btn-danger-bg);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.error-line {
    color: var(--text-primary);
    font-weight: 500;
}

.error-message {
    color: var(--btn-danger-bg);
    font-size: 0.8rem;
    font-weight: 600;
}

.no-errors {
    text-align: center;
    padding: 30px;
    color: #28a745;
    font-weight: 500;
}

.no-errors::before {
    content: '✓';
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.results-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.results-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}

.results-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    color: #495057;
}

.results-legend .legend-label {
    font-weight: 600;
    margin-right: 4px;
}

.results-legend .legend-text {
    margin-right: 10px;
    font-size: 0.9rem;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--input-bg);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.results-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.results-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.results-tab-btn:hover {
    color: var(--accent-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card-list {
    max-height: 400px;
    overflow-y: auto;
}

.list-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0 12px 0;
}

.list-controls select {
    padding: 4px 6px;
}

.list-controls .chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.small-btn {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.small-btn:hover {
    background: #f8f9fa;
}

/* Accessibility: visually hidden text */
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    /* prevent line breaks */
}

.card-item {
    display: grid;
    grid-template-columns: 56px 1fr 100px 200px;
    /* qty | name | badges | price */
    align-items: center;
    gap: 8px 14px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--input-bg);
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
    min-height: 48px;
    /* lock row height */
}

.card-item:hover {
    background: var(--card-bg);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.card-info {
    flex: 1;
}

.card-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-quantity {
    background: var(--accent-color);
    color: var(--text-on-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 56px;
    /* fixed width for alignment */
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-badges {
    width: 100px;
    /* reserve space so prices align */
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    /* align icons to the right edge */
    height: 22px;
    /* fix badge row height */
}

.card-price {
    justify-self: end;
    width: 200px;
    /* fixed price column */
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    /* make numbers align like in spreadsheets */
}

.foil-badge {
    background: #ffd700;
    color: #333;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

.partial-match {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 5px 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.partial-match-quantity {
    font-weight: 600;
    color: #495057;
    min-width: 30px;
}

.partial-match-name {
    flex: 1;
    color: #495057;
}

.partial-match-reason {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
}

.partial-matches {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.partial-matches-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

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

    .input-tabs {
        flex-direction: column;
    }

    .input-tab-btn {
        text-align: center;
    }

    .results-stats {
        grid-template-columns: 1fr;
    }

    .results-tabs {
        flex-direction: column;
    }

    .tab-btn {
        text-align: center;
    }

    .feedback-tabs {
        flex-direction: column;
    }

    .feedback-tab-btn {
        text-align: center;
    }

    .error-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 15px;
    }
}

/* Scrollbar Styling */
.card-list::-webkit-scrollbar {
    width: 8px;
}

.card-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.card-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.card-list::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Manual API Dialog */
.manual-api-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.manual-api-dialog .dialog-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.manual-api-dialog h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.manual-api-dialog p {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #495057;
}

.manual-api-dialog .instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #007bff;
}

.manual-api-dialog .instructions h4 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.1rem;
}

.manual-api-dialog .instructions ol {
    margin-left: 20px;
    color: #495057;
}

.manual-api-dialog .instructions li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.manual-api-dialog textarea {
    width: 100%;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px;
    resize: vertical;
    min-height: 200px;
}

.manual-api-dialog textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.manual-api-dialog .dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.manual-api-dialog .dialog-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.manual-api-dialog #submitManualApi {
    background: #007bff;
    color: white;
}

.manual-api-dialog #submitManualApi:hover {
    background: #0056b3;
}

.manual-api-dialog #cancelManualApi {
    background: #6c757d;
    color: white;
}

.manual-api-dialog #cancelManualApi:hover {
    background: #545b62;
}

/* Total Price Display */
.total-price {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    text-align: center;
}

.total-price-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.total-price-label {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.total-price-value {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.total-price-note {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

/* Price Loading Indicator */
.price-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    color: #667eea;
    font-weight: 600;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Price display with provider */
.card-price.loading {
    color: #6c757d;
    font-style: italic;
}

.card-price.has-price {
    color: #28a745;
    font-weight: 600;
}

@media (max-width: 768px) {
    .total-price {
        padding: 15px;
        margin: 15px 0;
    }

    .total-price-value {
        font-size: 2rem;
    }

    .total-price-info {
        gap: 6px;
    }

    .price-loading-indicator {
        padding: 10px;
        font-size: 0.9rem;
    }
}

/* Fallback price styles */
.fallback-price {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9em;
    position: relative;
}

.fallback-icon {
    font-size: 0.8em;
    color: #f39c12;
}

.fallback-tooltip {
    cursor: help;
    color: #e67e22;
    font-size: 0.8em;
    margin-left: 2px;
    transition: color 0.2s ease;
}

.fallback-tooltip:hover {
    color: #d35400;
}

.card-price.fallback {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 4px 8px;
    color: #856404;
}