/* ===================================
   SCRIPT CARD STYLES
   =================================== */

.script-card-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

.script-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.script-preview-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.script-main-preview {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    width: 100%;
}

.script-card-modern:hover .script-main-preview {
    transform: scale(1.08);
}

.script-screenshots-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding-top: 40px;
}

.script-card-modern:hover .script-screenshots-overlay {
    opacity: 1;
}

.screenshot-thumb {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.screenshot-thumb:hover {
    transform: scale(1.15);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.screenshot-count-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.script-card-modern .card-body {
    flex: 1;
}

.script-card-modern .card-title a {
    transition: color 0.2s ease;
}

.script-card-modern .card-title a:hover {
    color: #8b5cf6 !important;
}

.script-card-modern .badge {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.script-card-modern .btn-primary {
    background: #8b5cf6;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.script-card-modern .btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.script-card-modern .btn-outline-secondary {
    transition: all 0.2s ease;
}

.script-card-modern .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
}

/* ===================================
   PLAN AVAILABILITY INDICATORS
   =================================== */

/* Container for full-width layout */
.plan-indicator-container {
    width: 100%;
    display: block;
}

/* Base Plan Indicator Styles - Full Width Block */
.plan-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: 0.3px;
    text-align: center;
}

.plan-indicator i {
    font-size: 0.9em;
    opacity: 0.95;
}

.plan-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Free Plans - Green with subtle glow */
.plan-badge-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.plan-badge-free:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* Premium Plans - Purple gradient matching your theme */
.plan-badge-premium {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    border-color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

.plan-badge-premium:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

/* Mixed Plans - Gradient blend */
.plan-badge-mixed {
    background: linear-gradient(135deg, #10b981 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.plan-badge-mixed:hover {
    background: linear-gradient(135deg, #059669 0%, #7c3aed 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

/* Unavailable - Dark theme compatible */
.plan-badge-unavailable {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #9ca3af;
    border-color: #374151;
    box-shadow: 0 2px 8px rgba(55, 65, 81, 0.15);
}

.plan-badge-unavailable:hover {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #d1d5db;
    box-shadow: 0 6px 16px rgba(55, 65, 81, 0.25);
}

/* Size Variations */
.badge-xs {
    padding: 6px 12px;
    font-size: 0.65rem;
    border-radius: 6px;
}

.badge-sm {
    padding: 8px 16px;
    font-size: 0.75rem;
    border-radius: 8px;
}

.badge-md {
    padding: 10px 20px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.badge-lg {
    padding: 12px 24px;
    font-size: 0.95rem;
    border-radius: 12px;
}

/* Tooltip Styles */
.plan-tooltip-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px 3px;
    font-weight: 600;
}

.plan-tooltip-free {
    background: #10b981;
    color: white;
}

.plan-tooltip-premium {
    background: #8b5cf6;
    color: white;
}

/* Detail View Styles */
.plan-details-label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
}

.plan-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-detail-free {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.plan-detail-premium {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.plan-price {
    opacity: 0.8;
    font-weight: 500;
}

/* Animation for loading states */
@keyframes planBadgeShimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.plan-indicator.loading {
    animation: planBadgeShimmer 1.5s ease-in-out infinite;
}

/* ===================================
   DARK MODE SUPPORT
   =================================== */

/* Dark mode support for script cards */
@media (prefers-color-scheme: dark) {
    .script-card-modern {
        background: #1a1a1a;
    }
    
    .script-preview-container {
        background: #2a2a2a;
    }
    
    .script-card-modern .card-title a {
        color: #e0e0e0 !important;
    }
    
    .script-card-modern .card-title a:hover {
        color: #8b5cf6 !important;
    }
    
    /* Dark mode support for plan indicators */
    .plan-details-label {
        color: #9ca3af;
    }
    
    .plan-detail-free {
        background: rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.3);
    }
    
    .plan-detail-premium {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.3);
    }
}

/* ===================================
   HOMEPAGE SCRIPT CARDS (TRADING STRATEGY CARDS)
   =================================== */

.trading-strategy-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: 2rem;
}

.trading-strategy-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Verification Badge */
.strategy-verification-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: #ffffff;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0;
}

.strategy-verification-badge i {
    font-size: 1rem;
}

/* Chart Preview */
.strategy-chart-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f8f9fa;
}

.strategy-chart-preview .chart-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.trading-strategy-card:hover .chart-image {
    transform: scale(1.05);
}

.strategy-chart-preview .chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.chart-placeholder span {
    font-size: 1rem;
    font-weight: 500;
}

/* Strategy Info */
.strategy-info {
    padding: 2rem;
}

.strategy-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Strategy Details */
.strategy-details {
    margin-bottom: 1.25rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-item i {
    color: #8b5cf6;
    width: 16px;
    font-size: 0.875rem;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #1f2937;
    font-weight: 600;
}

/* Enhanced Detail Items Styling */
.detail-item.enhanced {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 12px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.detail-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.detail-section i {
    color: #8b5cf6;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.detail-section .detail-label {
    font-size: 0.75rem;
    color: #8b5cf6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section .detail-value-enhanced {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.2;
}

.detail-item.enhanced:hover {
    background: rgba(139, 92, 246, 0.08);
    transform: translateX(2px);
}

.detail-item.enhanced i {
    color: #8b5cf6;
    width: 20px;
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.detail-section + .detail-section {
    padding-left: 16px;
}

.detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-value-enhanced {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Plan Availability Section for Homepage Cards */
.plan-availability-section {
    margin-top: 0.75rem;
}

/* Pricing */
.strategy-pricing {
    margin-bottom: 1.5rem;
}

.price-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-original {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 1rem;
    font-weight: 500;
}

.price-current {
    color: #8b5cf6;
    font-size: 1.5rem;
    font-weight: 700;
}

.price-period {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
}

.price-free {
    color: #22c55e;
    font-size: 1.25rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 12px;
    border-radius: 6px;
}


/* Strategy Disclaimer */
.strategy-disclaimer {
    background: rgba(107, 114, 128, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.strategy-disclaimer i {
    color: #9ca3af;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Action Buttons */
.strategy-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 1.5rem;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.action-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #8b5cf6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.25rem 0;
}

.action-link:hover {
    color: #7c3aed;
    text-decoration: underline;
    transform: translateX(4px);
}

.action-link i {
    margin-top: 2px;
    flex-shrink: 0;
}

.action-note {
    display: block;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-view-strategy {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    display: block;
    flex: 1;
}

.btn-view-strategy:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-view-chart {
    background: transparent;
    color: #8b5cf6;
    padding: 12px 20px;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.btn-view-chart:hover {
    background: #8b5cf6;
    color: #ffffff;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Grid Layout for Cards */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ===================================
   HOMEPAGE SCRIPT CARDS - RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .trading-strategy-card {
        margin-bottom: 1.5rem;
    }
    
    .strategy-info {
        padding: 1.25rem;
    }
    
    .strategy-title {
        font-size: 1.25rem;
    }
    
    .metrics-row {
        gap: 0.75rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .metric-value {
        font-size: 1rem;
    }
    
    .price-current {
        font-size: 1.25rem;
    }
    
    .btn-view-strategy {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .strategy-verification-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .strategy-chart-preview {
        height: 160px;
    }
    
    .strategy-info {
        padding: 1rem;
    }
    
    .strategy-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .metric-card {
        padding: 0.625rem;
    }
    
    .strategy-disclaimer {
        padding: 0.625rem;
        font-size: 0.75rem;
    }
    
    .action-links {
        gap: 0.375rem;
    }
    
    .action-link {
        font-size: 0.8rem;
    }
    
    .scripts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }
}

/* ===================================
   HOMEPAGE SCRIPT CARDS - DARK MODE SUPPORT
   =================================== */

/* Dark mode for trading strategy cards */
.dark .trading-strategy-card {
    background: var(--darkModePrimaryColor);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.dark .trading-strategy-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.dark .strategy-chart-preview {
    background: var(--darkModeSecondaryColor);
}

.dark .strategy-title {
    color: #ffffff;
}

.dark .detail-label {
    color: rgba(255, 255, 255, 0.7);
}

.dark .detail-value {
    color: #ffffff;
}

.dark .detail-section .detail-label {
    color: #c4b5fd;
}

.dark .detail-item.enhanced {
    background: rgba(139, 92, 246, 0.1);
}

.dark .detail-item.enhanced:hover {
    background: rgba(139, 92, 246, 0.15);
}

.dark .detail-section + .detail-section {
    border-left-color: rgba(139, 92, 246, 0.3);
}

.dark .detail-value-enhanced {
    color: #ffffff;
}

.dark .price-original {
    color: rgba(255, 255, 255, 0.5);
}

.dark .price-period {
    color: rgba(255, 255, 255, 0.7);
}

.dark .metric-card {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Dark mode text-dark override for form labels */
.dark .text-dark.form-label {
    color: #ffffff !important;
}

.dark .metric-label {
    color: rgba(255, 255, 255, 0.7);
}

.dark .strategy-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
}

.dark .strategy-disclaimer i {
    color: rgba(255, 255, 255, 0.5);
}

.dark .action-note {
    color: rgba(255, 255, 255, 0.5);
}


/* ===================================
   SUBSCRIPTION STATUS BADGES FIX
   =================================== */

/* Override badge-soft for light mode visibility */
.badge-soft {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

/* Light mode - visible badges */
.badge-soft.badge-ok {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #16a34a !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.badge-soft.badge-warn {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #d97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* Dark mode - keep original styling */
.dark .badge-soft.badge-ok {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

.dark .badge-soft.badge-warn {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}


/* ===================================
   TRADING ANALYSIS PREVIEW STYLES
   =================================== */

/* Loading Indicator */
#analysisLoading {
    border-left: 4px solid #0dcaf0;
}

#analysisLoading .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 0.15em;
}

/* Error Display */
#analysisError {
    border-left: 4px solid #dc3545;
    animation: slideIn 0.3s ease-out;
}

/* Preview Container */
#analysisPreview {
    animation: slideIn 0.4s ease-out;
    border: 2px solid #198754;
}

#analysisPreview .card-header {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

/* Metric Cards */
#analysisPreview .card.bg-light {
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#analysisPreview .card.bg-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

#analysisPreview .card.bg-light .text-muted {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

#analysisPreview .card.bg-light h4 {
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Re-analyze Button */
#reAnalyzeBtn {
    font-size: 0.85rem;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

#reAnalyzeBtn:hover {
    transform: scale(1.05);
}

#reAnalyzeBtn.btn-warning {
    animation: pulse 2s ease-in-out infinite;
}

/* Chart Container */
#analysisPreview canvas {
    max-height: 200px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #analysisPreview .row.g-3 {
        gap: 0.75rem !important;
    }
    
    #analysisPreview .card.bg-light {
        padding: 0.75rem;
    }
    
    #analysisPreview .card.bg-light h4 {
        font-size: 1.25rem;
    }
    
    #analysisPreview .card-header h6 {
        font-size: 0.9rem;
    }
    
    #reAnalyzeBtn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 576px) {
    #analysisPreview .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #analysisPreview .card.bg-light h4 {
        font-size: 1.125rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #analysisPreview .card.bg-light {
        background: rgba(255, 255, 255, 0.05) !important;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    #analysisPreview .card.bg-light:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(139, 92, 246, 0.4);
    }
    
    #analysisPreview .card.bg-light h4 {
        color: #ffffff;
    }
    
    #analysisPreview .card.bg-light .text-muted {
        color: rgba(255, 255, 255, 0.7) !important;
    }
}

.dark #analysisPreview .card.bg-light {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark #analysisPreview .card.bg-light:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(139, 92, 246, 0.4);
}

.dark #analysisPreview .card.bg-light h4 {
    color: #ffffff;
}

.dark #analysisPreview .card.bg-light .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ===================================
   PERFORMANCE TAB STYLES
   =================================== */

/* Calculate Performance Card */
#calculationCard {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* Light mode - default */
body:not(.dark) #calculationCard {
    background: #ffffff !important;
}

body:not(.dark) #calculationCard .card-body {
    padding: 1.5rem;
    background: #ffffff !important;
    color: #1f2937 !important;
}

body:not(.dark) #calculationCard .card-body .text-muted {
    color: #6b7280 !important;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

body:not(.dark) #calculationCard .form-label {
    font-weight: 600;
    color: #1f2937 !important;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

body:not(.dark) #calculationCard .form-control {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #ffffff !important;
    color: #1f2937 !important;
}

body:not(.dark) #calculationCard small.text-muted {
    color: #9ca3af !important;
    font-size: 0.8rem;
}

#calculationCard .card-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    padding: 1.25rem 1.5rem;
}

#calculationCard .card-header h5 {
    color: #ffffff;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#calculationCard .card-header h5 i {
    font-size: 1.25rem;
}

#calculationCard .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

#calculatePerformanceBtn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

#calculatePerformanceBtn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

#calculatePerformanceBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading and Error States */
#performanceLoading {
    background: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.3);
    border-left: 4px solid #0dcaf0;
    color: #0a7ea4;
    border-radius: 8px;
    padding: 1rem;
}

#performanceLoading .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 0.15em;
    color: #0dcaf0;
}

#performanceError {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-left: 4px solid #dc3545;
    color: #b02a37;
    border-radius: 8px;
    padding: 1rem;
}

/* Performance Section Container */
.performance-section {
    margin-bottom: 2rem;
}

.performance-section h5 {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.performance-section h5 i {
    font-size: 1.25rem;
}

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

/* Stat Card Variants */
.stat-card-success {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.02) 100%);
}

.stat-card-success .stat-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.stat-card-success .stat-value {
    color: #16a34a;
}

.stat-card-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.stat-card-danger .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.stat-card-danger .stat-value {
    color: #dc2626;
}

.stat-card-warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.stat-card-warning .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.stat-card-warning .stat-value {
    color: #d97706;
}

.stat-card-info {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.stat-card-info .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.stat-card-info .stat-value {
    color: #2563eb;
}

/* Chart Container */
.chart-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.chart-container canvas {
    max-height: 400px;
}

/* Performance Table */
.performance-table {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.performance-table thead {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #ffffff;
}

.performance-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.performance-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.performance-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.performance-table tbody td {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
}

.performance-table tbody tr:last-child {
    border-bottom: none;
}

/* Configuration Items */
.config-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.config-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.config-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.config-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #8b5cf6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state .text-muted {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* ===================================
   PERFORMANCE TAB - RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
    
    .performance-table thead th,
    .performance-table tbody td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .config-item {
        padding: 1rem;
    }
    
    .config-value {
        font-size: 1.125rem;
    }
}

@media (max-width: 576px) {
    .performance-section h5 {
        font-size: 1.125rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 0.875rem;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }
    
    .stat-value {
        font-size: 1.125rem;
    }
    
    .chart-container {
        padding: 0.875rem;
    }
    
    .chart-title {
        font-size: 0.9rem;
    }
    
    .chart-container canvas {
        max-height: 250px;
    }
    
    .performance-table {
        font-size: 0.8rem;
    }
    
    .performance-table thead th,
    .performance-table tbody td {
        padding: 0.625rem 0.5rem;
    }
    
    .config-item {
        padding: 0.875rem;
    }
    
    .config-label {
        font-size: 0.7rem;
    }
    
    .config-value {
        font-size: 1rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
}

/* ===================================
   PERFORMANCE TAB - DARK MODE SUPPORT
   =================================== */

@media (prefers-color-scheme: dark) {
    .performance-section h5 {
        color: #ffffff;
    }
    
    .stat-card {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .stat-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(139, 92, 246, 0.4);
    }
    
    .stat-label {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .stat-value {
        color: #ffffff;
    }
    
    .chart-container {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .chart-title {
        color: #ffffff;
    }
    
    .performance-table {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .performance-table tbody tr {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .performance-table tbody tr:hover {
        background: rgba(139, 92, 246, 0.1);
    }
    
    .performance-table tbody td {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .config-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .config-item:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(139, 92, 246, 0.4);
    }
    
    .config-label {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .empty-state {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .empty-state i {
        color: rgba(255, 255, 255, 0.2);
    }
    
    .empty-state .text-muted {
        color: rgba(255, 255, 255, 0.5);
    }
}

.dark .performance-section h5 {
    color: #ffffff;
}

.dark .stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
}

.dark .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.dark .stat-value {
    color: #ffffff;
}

.dark .chart-container {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .chart-title {
    color: #ffffff;
}

.dark .performance-table {
    background: rgba(255, 255, 255, 0.05);
}

.dark .performance-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .performance-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.1);
}

.dark .performance-table tbody td {
    color: rgba(255, 255, 255, 0.9);
}

.dark .config-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .config-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
}

.dark .config-label {
    color: rgba(255, 255, 255, 0.7);
}

.dark .empty-state {
    color: rgba(255, 255, 255, 0.7);
}

.dark .empty-state i {
    color: rgba(255, 255, 255, 0.2);
}

.dark .empty-state .text-muted {
    color: rgba(255, 255, 255, 0.5);
}


/* ===================================
   PERFORMANCE TAB CARD STYLES
   =================================== */

/* Performance metric cards - adapt to theme */
.performance-section .card {
    transition: all 0.3s ease;
}

.performance-section .card:hover {
    transform: none !important;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.15), inset 0 -2px 4px rgba(0,0,0,0.7), 0 8px 16px rgba(0,0,0,0.4) !important;
}

/* Dark mode support - target body.dark class */
body.dark .performance-section .card {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark .performance-section .card:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.15), inset 0 -2px 4px rgba(0,0,0,0.7), 0 8px 16px rgba(0,0,0,0.4) !important;
}

/* Icon circle backgrounds in dark mode */
body.dark .performance-section .rounded-circle {
    background-color: rgba(255, 255, 255, 0.1) !important;
}


/* Text color for card values - adapts to theme */
.text-card {
    color: #212529; /* Dark text for light mode */
}

body.dark .text-card {
    color: #f8f9fa; /* Light text for dark mode */
}

/* Table text visibility in both modes */
.performance-table thead th {
    color: #ffffff !important; /* Always white on purple background */
}

.performance-table tbody td {
    color: #212529; /* Dark text for light mode */
}

body.dark .performance-table tbody td {
    color: #f8f9fa; /* Light text for dark mode */
}

/* Preserve profit/loss colors in dark mode */
body.dark .performance-table tbody td.text-success {
    color: #22c55e !important; /* Green for positive profit */
}

body.dark .performance-table tbody td.text-danger {
    color: #ef4444 !important; /* Red for negative profit */
}

/* Ensure table background is visible in light mode */
.performance-table {
    background: #ffffff;
}

body.dark .performance-table {
    background: rgba(255, 255, 255, 0.05) !important;
}


/* ===================================
   PERFORMANCE CALCULATOR - DARK MODE SUPPORT
   =================================== */

/* Performance calculator cards in dark mode */
.dark #performanceResults .card {
    background-color: var(--darkModePrimaryColor) !important;
    border-color: var(--darkModeSecondaryColor) !important;
    color: #ffffff;
}

.dark #performanceResults .card-body {
    color: #ffffff;
}

.dark #performanceResults .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.dark #performanceResults h5 {
    color: #ffffff;
}

/* Performance section styling in dark mode */
.dark .performance-section .card {
    background-color: var(--darkModePrimaryColor) !important;
    border-color: var(--darkModeSecondaryColor) !important;
}

.dark .performance-section .card:hover {
    border-color: rgba(139, 92, 246, 0.4) !important;
}

/* Table styling in dark mode */
.dark .performance-section .table {
    color: #ffffff;
}

.dark .performance-section .table-light {
    background-color: var(--darkModeSecondaryColor) !important;
    color: #ffffff !important;
}

.dark .performance-section .table-hover tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.1) !important;
}

/* Alert styling in dark mode */
.dark #performanceResults .alert-success {
    background-color: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #4ade80 !important;
}

.dark #performanceResults .alert-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #60a5fa !important;
}

/* Tab navigation in dark mode */
.dark .nav-tabs-purple {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark .nav-tabs-purple .nav-link {
    color: rgba(255, 255, 255, 0.7);
}

.dark .nav-tabs-purple .nav-link:hover {
    color: #c4b5fd;
    background-color: rgba(139, 92, 246, 0.15);
}

.dark .nav-tabs-purple .nav-link.active {
    color: #ffffff;
    background-color: rgba(139, 92, 246, 0.2);
}

/* Chart containers in dark mode */
.dark .chart-container {
    background-color: var(--darkModePrimaryColor) !important;
    border-color: var(--darkModeSecondaryColor) !important;
}

/* Badge styling in dark mode */
.dark .badge.bg-success {
    background-color: #22c55e !important;
    color: #ffffff !important;
}

/* ===================================
   CALCULATE PERFORMANCE CARD - DARK MODE
   =================================== */

.dark #calculationCard {
    background: var(--darkModePrimaryColor);
    border-color: rgba(139, 92, 246, 0.3);
}

.dark #calculationCard .card-body {
    background: var(--darkModePrimaryColor);
}

.dark #calculationCard .card-body .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.dark #calculationCard .form-label {
    color: #ffffff;
}

.dark #calculationCard .form-control {
    background: var(--darkModeSecondaryColor);
    border-color: var(--darkModeThirdColor);
    color: #ffffff;
}

.dark #calculationCard .form-control:focus {
    background: var(--darkModeSecondaryColor);
    border-color: #8b5cf6;
    color: #ffffff;
}

.dark #calculationCard .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.dark #calculationCard small.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.dark #performanceLoading {
    background: rgba(13, 202, 240, 0.15);
    border-color: rgba(13, 202, 240, 0.4);
    color: #60d5f5;
}

.dark #performanceLoading .spinner-border {
    color: #c4b5fd !important;
    border-color: rgba(196, 181, 253, 0.3) !important;
    border-right-color: #c4b5fd !important;
}

.dark #performanceError {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
    color: #f87171;
}

/* Media query for prefers-color-scheme dark */
@media (prefers-color-scheme: dark) {
    #calculationCard {
        background: var(--darkModePrimaryColor);
        border-color: rgba(139, 92, 246, 0.3);
    }

    #calculationCard .card-body {
        background: var(--darkModePrimaryColor);
    }

    #calculationCard .card-body .text-muted {
        color: rgba(255, 255, 255, 0.7) !important;
    }

    #calculationCard .form-label {
        color: #ffffff;
    }

    #calculationCard .form-control {
        background: var(--darkModeSecondaryColor);
        border-color: var(--darkModeThirdColor);
        color: #ffffff;
    }

    #calculationCard .form-control:focus {
        background: var(--darkModeSecondaryColor);
        border-color: #8b5cf6;
        color: #ffffff;
    }

    #calculationCard .form-control::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

    #calculationCard small.text-muted {
        color: rgba(255, 255, 255, 0.6) !important;
    }

    #performanceLoading {
        background: rgba(13, 202, 240, 0.15);
        border-color: rgba(13, 202, 240, 0.4);
        color: #60d5f5;
    }

    #performanceLoading .spinner-border {
        color: #8B5CF6 !important;
        border-color: rgba(139, 92, 246, 0.25) !important;
        border-right-color: #8B5CF6 !important;
    }

    #performanceError {
        background: rgba(220, 53, 69, 0.15);
        border-color: rgba(220, 53, 69, 0.4);
        color: #f87171;
    }
}
