/* PokeTracker - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.beta {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
    font-weight: 500;
}

.nav a:hover,
.nav a.active {
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Hero Section */
.hero {
    background: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #1e293b;
}

.hero .highlight {
    color: #3b82f6;
}

.hero p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Components */
.search-container {
    max-width: 500px;
    margin: 0 auto 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.search-btn:hover {
    background: #2563eb;
}

/* Section Styles */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    color: #1e293b;
}

/* Card Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f1f5f9;
    padding: 1rem;
}

.card-content {
    padding: 1.5rem;
}

.card-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.card-details {
    color: #64748b;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.card-rarity {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-info {
    display: flex;
    flex-direction: column;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
}

.price-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.price-up {
    color: #10b981;
}

.price-down {
    color: #ef4444;
}

/* Buttons */
.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

/* Features Grid */
.features {
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    background: #dbeafe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.feature h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.feature p {
    color: #64748b;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 2rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    font-weight: bold;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

.hidden {
    display: none;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1001;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #10b981;
    color: white;
}

.notification.error {
    background: #ef4444;
    color: white;
}

.notification.info {
    background: #3b82f6;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* Enhanced Grading System Styles */
/* Add this to your styles.css file */

/* ======================
   GRADED CARD STYLES
   ====================== */

.graded-card {
    border: 2px solid #f59e0b;
    background: linear-gradient(135deg, #fefbf3, #ffffff);
    position: relative;
    overflow: visible;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.graded-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.15);
}

.graded-card.hot {
    border-color: #dc2626;
    animation: pulse-hot 2s infinite;
}

.graded-card.active {
    border-color: #059669;
}

.graded-card.limited {
    border-color: #6b7280;
}

@keyframes pulse-hot {
    0%, 100% { border-color: #dc2626; }
    50% { border-color: #f97316; }
}

/* Card Image Container */
.card-image-container {
    position: relative;
    background: #f8fafc;
}

.grading-badges {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 10;
}

.grades-badge {
    background: linear-gradient(45deg, #f59e0b, #eab308);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.grades-count {
    font-size: 0.9rem;
    font-weight: 900;
}

.grades-label {
    font-size: 0.6rem;
    opacity: 0.9;
}

.hot-badge {
    background: linear-gradient(45deg, #dc2626, #ef4444);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.6rem;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

.market-badge {
    background: linear-gradient(45deg, #059669, #10b981);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.6rem;
    font-weight: bold;
}

/* Investment Score Indicator */
.investment-score {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.25rem;
    padding: 0.3rem;
    width: 60px;
    height: 20px;
    border: 1px solid #e2e8f0;
}

.score-fill {
    height: 100%;
    border-radius: 0.15rem;
    transition: width 0.8s ease;
}

.investment-score.excellent .score-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.investment-score.good .score-fill {
    background: linear-gradient(90deg, #eab308, #d97706);
}

.investment-score.fair .score-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.investment-score.poor .score-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: bold;
    color: #1e293b;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* Graded Pricing Section */
.graded-pricing {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border: 1px solid #f59e0b;
}

.price-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.min-price {
    color: #059669;
    font-size: 0.9rem;
}

.range-separator {
    color: #6b7280;
    font-weight: normal;
}

.max-price {
    color: #dc2626;
    font-size: 1.1rem;
}

.price-multiplier {
    background: rgba(255,255,255,0.6);
    color: #92400e;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Top Grade Display */
.top-grade-display {
    background: rgba(255,255,255,0.7);
    padding: 0.75rem;
    border-radius: 0.4rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.grade-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.grade-name {
    font-weight: bold;
    color: #1e293b;
    font-size: 0.95rem;
}

.grade-company {
    padding: 0.15rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
}

.grade-company.psa {
    background: #fee2e2;
    color: #dc2626;
}

.grade-company.bgs {
    background: #ede9fe;
    color: #7c3aed;
}

.grade-company.cgc {
    background: #dcfce7;
    color: #059669;
}

.grade-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grade-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #059669;
}

.grade-listings {
    font-size: 0.8rem;
    color: #64748b;
}

/* Grades Preview */
.grades-preview {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.grade-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.2rem 0;
}

.grade-preview-item .grade {
    font-weight: 600;
    color: #374151;
}

.grade-preview-item .grade.psa {
    color: #dc2626;
}

.grade-preview-item .grade.bgs {
    color: #7c3aed;
}

.grade-preview-item .grade.cgc {
    color: #059669;
}

.grade-preview-item .price {
    color: #059669;
    font-weight: 600;
}

.more-grades {
    text-align: center;
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
    margin-top: 0.3rem;
    padding: 0.2rem;
    background: rgba(255,255,255,0.5);
    border-radius: 0.2rem;
}

/* Market Indicators */
.market-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(245, 158, 11, 0.3);
}

.market-indicators span {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-weight: 600;
    text-transform: uppercase;
}

.liquidity.high, .volatility.low {
    background: #dcfce7;
    color: #166534;
}

.liquidity.medium, .volatility.medium {
    background: #fef3c7;
    color: #92400e;
}

.liquidity.low, .volatility.high {
    background: #fee2e2;
    color: #991b1b;
}

/* ======================
   LOADING STATES
   ====================== */

.loading-grading {
    opacity: 0.8;
    pointer-events: none;
}

.grading-loading-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    z-index: 10;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner.large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.pricing-loading {
    text-align: center;
    padding: 1rem;
}

.loading-text {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.loading-bar {
    background: #e5e7eb;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    animation: loading-slide 1.5s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* ======================
   PROGRESS OVERLAY
   ====================== */

.grading-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.progress-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.progress-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #eab308);
    transition: width 0.5s ease;
}

.progress-stats {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ======================
   NOTIFICATION STYLES
   ====================== */

.grading-complete-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-icon {
    font-size: 1.2rem;
}

/* ======================
   ENHANCED MODAL STYLES
   ====================== */

.grading-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.grading-modal {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.enhanced-modal {
    max-width: 1100px;
}

.loading-modal {
    max-width: 500px;
    max-height: 400px;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.header-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-stats span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.investment-score.excellent {
    background: rgba(16, 185, 129, 0.2) !important;
}

.investment-score.good {
    background: rgba(245, 158, 11, 0.2) !important;
}

.investment-score.fair {
    background: rgba(239, 68, 68, 0.2) !important;
}

.investment-score.poor {
    background: rgba(107, 114, 128, 0.2) !important;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.close-btn:hover {
    opacity: 1;
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Summary Section */
.grading-summary {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: white;
    padding: 1.2rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 1.5rem;
    background: #f0f9ff;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.card-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e293b;
    line-height: 1.2;
}

.card-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Modal Tabs */
.modal-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #374151;
}

.tab-btn.active {
    color: #3b82f6;
    background: white;
    border-bottom-color: #3b82f6;
}

.tab-content {
    flex: 1;
    position: relative;
}

.tab-panel {
    display: none;
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.tab-panel.active {
    display: block;
}

/* Grades Panel */
.grades-panel {
    max-height: 60vh;
    overflow-y: auto;
}

.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.grade-card.detailed {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.2rem;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s;
}

.grade-card.detailed:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.grade-card.psa {
    border-left-color: #dc2626;
}

.grade-card.bgs {
    border-left-color: #7c3aed;
}

.grade-card.cgc {
    border-left-color: #059669;
}

.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grade-liquidity {
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
}

.main-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #059669;
    margin-bottom: 0.5rem;
}

.price-range {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.grade-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.stat-label {
    color: #6b7280;
}

.stat-value {
    font-weight: 600;
    color: #1e293b;
}

.grade-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* ROI Panel */
.roi-panel {
    max-height: 60vh;
    overflow-y: auto;
}

.roi-calculator {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.calculator-form {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: grid;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.calculate-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calculate-btn:hover {
    background: #2563eb;
}

/* ROI Results */
.roi-results-display {
    margin-top: 1rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
}

.roi-results-display.excellent {
    background: #f0fdf4;
    border-color: #16a34a;
}

.roi-results-display.good {
    background: #fefce8;
    border-color: #eab308;
}

.roi-results-display.fair {
    background: #fef2f2;
    border-color: #ef4444;
}

.roi-results-display.poor {
    background: #f9fafb;
    border-color: #6b7280;
}

.roi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.roi-score {
    font-size: 1.5rem;
    font-weight: bold;
}

.roi-results-display.excellent .roi-score {
    color: #16a34a;
}

.roi-results-display.good .roi-score {
    color: #eab308;
}

.roi-results-display.fair .roi-score {
    color: #ef4444;
}

.roi-results-display.poor .roi-score {
    color: #6b7280;
}

.roi-breakdown {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.roi-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.roi-item.profit {
    font-weight: bold;
}

.roi-item.profit span:last-child {
    color: #16a34a;
}

/* ROI Scenarios */
.roi-scenarios {
    margin: 1rem 0;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.scenario {
    background: rgba(255,255,255,0.7);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.1);
}

.scenario-name {
    font-weight: 600;
    color: #374151;
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.scenario-roi {
    font-size: 1.2rem;
    font-weight: bold;
    color: #059669;
    margin-bottom: 0.25rem;
}

.scenario-desc {
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.3;
}

/* Risk Assessment */
.risk-assessment {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.risk-assessment.low {
    background: #dcfce7;
    border: 1px solid #16a34a;
}

.risk-assessment.medium {
    background: #fef3c7;
    border: 1px solid #eab308;
}

.risk-assessment.high {
    background: #fee2e2;
    border: 1px solid #ef4444;
}

.risk-assessment h6 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.risk-assessment ul {
    margin: 0;
    padding-left: 1rem;
}

.roi-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #fee2e2;
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    color: #991b1b;
}

/* Trends Panel */
.trends-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.trends-placeholder {
    text-align: center;
    max-width: 500px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.preview-trends {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
    text-align: left;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.indicator {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.indicator-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.indicator-value {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Recommendations Panel */
.recommendations-panel {
    max-height: 60vh;
    overflow-y: auto;
}

.recommendations-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.recommendation {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.recommendation.success {
    background: #f0fdf4;
    border-left-color: #16a34a;
}

.recommendation.warning {
    background: #fefce8;
    border-left-color: #eab308;
}

.recommendation.info {
    background: #f0f9ff;
    border-left-color: #3b82f6;
}

.rec-icon {
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

.rec-content {
    flex: 1;
}

.rec-message {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.rec-action {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

.general-tips {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.tips-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.tip {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.tip strong {
    color: #1e293b;
    display: block;
    margin-bottom: 0.5rem;
}

.tip p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Loading Modal Specific */
.loading-content {
    text-align: center;
}

.loading-content h3 {
    margin: 1rem 0 0.5rem 0;
    color: #1e293b;
}

.loading-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.step {
    padding: 0.5rem;
    border-radius: 0.25rem;
    background: #f3f4f6;
    color: #6b7280;
    transition: all 0.3s;
}

.step.active {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.step.completed {
    background: #dcfce7;
    color: #166534;
}

/* Standard Card Styles */
.standard-card {
    opacity: 0.9;
}

.no-grading-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #6b7280;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.6rem;
    font-weight: 600;
}

.standard-pricing {
    padding: 1rem;
    text-align: center;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.price-note {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.grading-btn {
    background: linear-gradient(45deg, #f59e0b, #eab308);
    border: none;
    color: white;
    flex: 1;
}

.grading-btn:hover {
    background: linear-gradient(45deg, #d97706, #ca8a04);
}

.roi-btn {
    background: #3b82f6;
    border: none;
    color: white;
    flex: 1;
}

.roi-btn:hover {
    background: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grading-modal {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grades-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: none;
        min-width: 120px;
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
    
    .indicators-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }
    
    .price-range-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .market-indicators {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-actions {
        flex-direction: column;
    }
    
    .grading-badges {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin: 0.5rem 0;
    }
    
    .investment-score {
        position: static;
        width: 100%;
        margin: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .grading-modal {
        margin: 0.25rem;
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .header-content h2 {
        font-size: 1.2rem;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .grade-preview-item {
        font-size: 0.7rem;
    }
    
    .top-grade-display {
        padding: 0.5rem;
    }
    
    .grade-pricing {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ======================
   DISPLAY MODE TOGGLE STYLES
   ====================== */

.display-mode-toggle {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.toggle-container label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.toggle-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toggle-btn {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.toggle-btn:hover {
    background: #f3f4f6;
    color: #374151;
    transform: translateY(-1px);
}

.toggle-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.toggle-btn.active:hover {
    background: #2563eb;
}

/* ======================
   QUICK GRADING PREVIEW STYLES
   ====================== */

.quick-preview {
    max-width: 600px;
    max-height: 80vh;
}

.quick-grading-preview {
    padding: 1.5rem;
}

.grading-summary-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
}

.summary-stat {
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e293b;
}

.stat-value.score-excellent {
    color: #059669;
}

.stat-value.score-good {
    color: #d97706;
}

.stat-value.score-fair {
    color: #dc2626;
}

.stat-value.score-poor {
    color: #6b7280;
}

.stat-value.market-hot {
    color: #dc2626;
}

.stat-value.market-active {
    color: #059669;
}

.stat-value.market-moderate {
    color: #d97706;
}

.stat-value.market-limited {
    color: #6b7280;
}

.top-grades-quick h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.grades-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.grade-item-quick {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border-left: 4px solid #3b82f6;
    transition: transform 0.2s;
}

.grade-item-quick:hover {
    transform: translateX(4px);
}

.grade-item-quick.psa {
    border-left-color: #dc2626;
}

.grade-item-quick.bgs {
    border-left-color: #7c3aed;
}

.grade-item-quick.cgc {
    border-left-color: #059669;
}

.grade-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.grade-name {
    font-weight: bold;
    color: #1e293b;
}

.grade-company {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grade-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.grade-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #059669;
}

.grade-listings {
    font-size: 0.8rem;
    color: #6b7280;
}

.quick-recommendation {
    background: #f0f9ff;
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

.quick-recommendation h4 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.quick-recommendation p {
    color: #1e293b;
    margin: 0;
    line-height: 1.5;
}

.quick-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* ======================
   NO DATA STATES
   ====================== */

.no-grading-data,
.error-content {
    text-align: center;
    padding: 3rem 2rem;
}

.no-grading-data .icon,
.error-content .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.no-grading-data h4,
.error-content h4 {
    color: #1e293b;
    margin-bottom: 1rem;
}

.no-grading-data p,
.error-content p {
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ======================
   LIVE DATA BADGES
   ====================== */

.live-data-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.6rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ======================
   LOADING OVERLAYS
   ====================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
}

.loading-price {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 1rem;
}

/* ======================
   ANIMATION KEYFRAMES
   ====================== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOut {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

@keyframes holographic {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ======================
   ACCESSIBILITY IMPROVEMENTS
   ====================== */

/* Focus states */
.tab-btn:focus,
.btn:focus,
.toggle-btn:focus,
.form-group input:focus,
.form-group select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
        border: 2px solid #3b82f6;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .graded-card {
        border-width: 3px;
    }
    
    .grade-company,
    .market-indicators span {
        border: 1px solid currentColor;
    }
    
    .btn,
    .toggle-btn {
        border: 2px solid currentColor;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ======================
   UTILITY CLASSES
   ====================== */

.fade-in {
    animation: fadeInUp 0.5s ease;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: bold;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* ======================
   CUSTOM SCROLLBARS
   ====================== */

.modal-body::-webkit-scrollbar,
.tab-panel::-webkit-scrollbar,
.grades-panel::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track,
.tab-panel::-webkit-scrollbar-track,
.grades-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb,
.tab-panel::-webkit-scrollbar-thumb,
.grades-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.tab-panel::-webkit-scrollbar-thumb:hover,
.grades-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar styling */
.modal-body,
.tab-panel,
.grades-panel {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ======================
   FINAL POLISH
   ====================== */

/* Ensure smooth transitions */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optimize rendering */
.graded-card,
.grading-modal {
    contain: layout style paint;
}

/* Improve text rendering */
.card-name,
.grade-name,
.modal-header h2 {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Print styles */
@media print {
    .grading-modal-overlay,
    .grading-progress-overlay,
    .grading-complete-notification,
    .display-mode-toggle {
        display: none !important;
    }
    
    .graded-card {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    .grading-badges,
    .investment-score,
    .card-actions {
        display: none;
    }
}
/* Affiliate Button Styles */
.affiliate-btn {
    background: linear-gradient(45deg, #ff6600, #ff9900);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.affiliate-btn:hover {
    background: linear-gradient(45deg, #e55a00, #e68a00);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.3);
}

.btn-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
    font-size: 0.8rem;
}

/* Affiliate Disclaimer */
.affiliate-disclaimer-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.disclaimer-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    margin: 1rem;
}

.disclaimer-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.affiliate-disclaimer {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #9a3412;
}
.live-data-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
}
