/**
 * Crypto Compare Styles
 * Styling for cryptocurrency comparison pages
 */

/* Override breadcrumb margin */
.breadcrumb {
    margin-bottom: 0 !important;
}

/* Comparison Results */
.comparison-results {
    margin: 30px 0;
}

/* Comparison Metrics Wrapper */
.comparison-metrics-wrapper {
    margin: 20px 0;
}

/* Comparison Metrics Row */
.comparison-metrics-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

/* Individual Metric */
.comparison-metric {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 280px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}


.comparison-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Metric Title */
.comparison-metric .metric-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 15px 0;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Metric Values Container */
.metric-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Individual Metric Value */
.metric-value {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.metric-value .symbol {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.metric-value .value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* VS Separator */
.metric-vs {
    font-size: 14px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
}

/* Winner/Higher value styling */
.metric-value.higher {
    position: relative;
    background: rgba(13, 160, 89, 0.08);
    border: 1px solid rgba(13, 160, 89, 0.3);
}

.metric-value.higher .symbol {
    color: #0da059;
}

.metric-value.higher .value {
    font-weight: 700;
    color: #0da059;
}

/* Small crown/checkmark icon for winner */
.metric-value.higher::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    color: #0da059;
    font-weight: bold;
}

/* Lower/Loser value styling */
.metric-value.lower {
    position: relative;
    background: rgba(234, 51, 35, 0.08);
    border: 1px solid rgba(234, 51, 35, 0.3);
}

.metric-value.lower .symbol {
    color: #ea3323;
}

.metric-value.lower .value {
    font-weight: 700;
    color: #ea3323;
}

/* Small X icon for loser */
.metric-value.lower::after {
    content: '✗';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    color: #ea3323;
    font-weight: bold;
}

/* Neutral styling for non-competitive metrics */
.metric-value.neutral {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Keep existing green/red colors for percentage changes */
.green {
    color: #0da059;
}

.red {
    color: #ea3323;
}

/* Comparison Table */
.comparison-table-wrapper {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 20px 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.comparison-table th {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border: none;
}

.comparison-table th:first-child {
    width: 40%;
}

.comparison-table th:nth-child(2),
.comparison-table th:nth-child(3) {
    width: 30%;
    text-align: center;
}

.comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: middle;
}

.comparison-table td:first-child {
    font-weight: 600;
    color: #666;
}

.comparison-table td:nth-child(2),
.comparison-table td:nth-child(3) {
    text-align: center;
    font-weight: 500;
}

.comparison-table tbody tr:hover {
    background: #f9f9f9;
}

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

/* Color coding for changes */
.comparison-table .green {
    color: #0da059;
}

.comparison-table .red {
    color: #ea3323;
}

/* Comparison Charts */
.comparison-charts {
    margin: 40px 0;
}

.comparison-charts h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    text-align: center;
}

.charts-row {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.chart-column {
    flex: 1;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-column h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    text-align: center;
}

/* Featured Comparisons */
.featured-comparisons {
    background: #f5f5f5;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin: 40px 0;
}

.featured-comparisons h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.featured-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.featured-item:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 991px) {
    .comparison-metric {
        flex: 1 1 calc(50% - 7.5px);
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .comparison-metrics-row {
        gap: 10px;
    }
    
    .comparison-metric {
        flex: 1 1 100%;
        min-width: unset;
        padding: 15px;
    }
    
    .metric-value .symbol {
        font-size: 14px;
    }
    
    .metric-value .value {
        font-size: 16px;
    }
    
    .charts-row {
        flex-direction: column;
    }
    
    .chart-column {
        margin-bottom: 20px;
    }
    
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
    }
    
    .comparison-table th:first-child {
        width: 50%;
    }
    
    .comparison-table th:nth-child(2),
    .comparison-table th:nth-child(3) {
        width: 25%;
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .featured-item {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .metric-values {
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-vs {
        font-size: 12px;
    }
    
    .comparison-table {
        font-size: 11px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 6px 8px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
}

/* Autocomplete styling for crypto selectors */
.crypto-autocomplete {
    width: 100%;
}

/* Error message styling */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #c00;
    text-align: center;
}

/* Loading state */
.loading-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #999;
    font-size: 16px;
}

/* Ensure comparison form fields are properly styled */
.gc-converter-wrapper .gc-converter-fields > div:nth-child(1),
.gc-converter-wrapper .gc-converter-fields > div:nth-child(2) {
    flex: 2;
}

/* Custom styling for comparison specific elements */
.comparison-metric-label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.comparison-metric-label .info-icon {
    font-size: 12px;
    color: #999;
    cursor: help;
}

/* Percentage badges */
.percentage-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.percentage-badge.positive {
    background: rgba(13, 160, 89, 0.1);
    color: #0da059;
}

.percentage-badge.negative {
    background: rgba(234, 51, 35, 0.1);
    color: #ea3323;
}

/* Chart improvements */
#chart-crypto1,
#chart-crypto2 {
    position: relative;
}

/* Comparison header with icons */
.comparison-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.comparison-header .crypto-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comparison-header .vs-separator {
    font-size: 20px;
    font-weight: 600;
    color: #666;
}

/* Animate chart appearance */
.chart-column {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.chart-column:nth-child(1) {
    animation-delay: 0.1s;
}

.chart-column:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forecast Button Styles */
.currency-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 15px 25px;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

a.currency-item {
    text-decoration: none;
    color: inherit;
}

a.currency-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0073aa;
    text-decoration: none;
}

.currency-item .fa {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

a.currency-item:hover .fa {
    transform: translateX(3px);
}

/* Title links styling */
.page-header__title h1 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-header__title h1 a:hover {
    color: #0073aa;
    text-decoration: underline;
}

/* Chart column with forecast button */
.chart-column {
    display: flex;
    flex-direction: column;
}

/* Responsive design for forecast buttons */
@media (max-width: 768px) {
    .currency-item {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .currency-item span {
        display: block;
        margin-top: 5px;
    }
    
    .currency-item span:first-child {
        margin-top: 0;
    }
}

.breadcrumb-search-wrapper {
    margin-bottom: 20px;
}