/* ============================================
   Cryptocurrency Converter Styles
   Dark theme matching article.css design system
   ============================================ */

/* ============================================
   Converter Widget - Main interactive component
   ============================================ */

.converter-widget {
    background: linear-gradient(135deg, #1e252f 0%, #252d38 100%);
    border: 1px solid #404245;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.converter-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b 0%, #44a4cd 50%, #fbbf24 100%);
}

/* Header with live rate */
.converter-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(64, 66, 69, 0.5);
}

.rate-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rate-label {
    color: #888;
    font-size: 0.9rem;
}

.rate-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #f7fff7;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    letter-spacing: -0.02em;
}

.rate-currency {
    color: #888;
    font-size: 1rem;
    font-weight: 500;
}

.rate-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

/* Live indicator with pulsing dot */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-converter 2s ease-in-out infinite;
}

@keyframes pulse-converter {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.price-change {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.price-change.positive {
    color: #4ade80;
}

.price-change.negative {
    color: #f87171;
}

/* Converter body - input fields */
.converter-body {
    padding: 1.5rem;
}

.converter-input-group {
    margin-bottom: 0.75rem;
}

.converter-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.converter-input-wrapper {
    display: flex;
    align-items: center;
    background: #161a1f;
    border: 2px solid #404245;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.converter-input-wrapper:focus-within {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.converter-input-wrapper.result {
    background: rgba(22, 26, 31, 0.8);
    border-color: rgba(64, 66, 69, 0.5);
}

.converter-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f7fff7;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    outline: none;
    width: 100%;
    min-width: 0;
}

.converter-input::placeholder {
    color: #555;
}

.converter-input::-webkit-outer-spin-button,
.converter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.converter-input[type=number] {
    -moz-appearance: textfield;
}

.converter-result {
    color: #4ade80;
}

.converter-asset {
    flex-shrink: 0;
    text-align: right;
    padding-left: 1rem;
    border-left: 1px solid rgba(64, 66, 69, 0.5);
    margin-left: 1rem;
}

.asset-symbol {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #f7fff7;
}

.asset-name {
    display: block;
    font-size: 0.75rem;
    color: #888;
}

/* Swap button */
.converter-swap-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

.converter-swap-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252931;
    border: 2px solid #404245;
    border-radius: 50%;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.converter-swap-btn:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
    transform: rotate(180deg);
    text-decoration: none;
}

/* Action buttons */
.converter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.converter-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid #404245;
    border-radius: 8px;
    color: #ced4da;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.converter-action-btn:hover {
    background: #404245;
    color: #f7fff7;
}

.converter-action-btn.copied,
.converter-action-btn.shared {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

/* Quick amount buttons */
.converter-quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(64, 66, 69, 0.5);
    background: rgba(22, 26, 31, 0.3);
}

.quick-amount-btn {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid #404245;
    border-radius: 6px;
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-amount-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

.quick-amount-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* Footer */
.converter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #161a1f;
    border-top: 1px solid rgba(64, 66, 69, 0.5);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.update-time {
    font-size: 0.75rem;
    color: #888;
}

.update-time i {
    margin-right: 0.25rem;
}

.trade-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ff6b6b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.trade-link:hover {
    color: #ff8787;
    text-decoration: none;
}

.trade-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.trade-link:hover i {
    transform: translateX(3px);
}

/* ============================================
   Conversion Table
   ============================================ */

.conversion-table-box {
    background: #1e252f;
    border: 1px solid #404245;
    border-radius: 12px;
    overflow: hidden;
}

.conversion-table {
    margin: 0;
    color: #ced4da;
}

.conversion-table thead th {
    background: rgba(22, 26, 31, 0.5);
    border-color: #404245;
    color: #f7fff7;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.conversion-table tbody td {
    padding: 0.875rem 1.25rem;
    border-color: rgba(64, 66, 69, 0.5);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9rem;
}

.conversion-table tbody tr:hover {
    background: rgba(255, 107, 107, 0.05);
}

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

/* ============================================
   Market Data Box
   ============================================ */

.market-data-box {
    background: #1e252f;
    border: 1px solid #404245;
    border-radius: 12px;
    padding: 1.5rem;
}

.market-data-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.market-data-item {
    text-align: center;
    padding: 1rem;
    background: rgba(22, 26, 31, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(64, 66, 69, 0.3);
}

.market-data-item .data-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.market-data-item .data-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #f7fff7;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.market-data-item .data-value.positive {
    color: #4ade80;
}

.market-data-item .data-value.negative {
    color: #f87171;
}

@media (max-width: 768px) {
    .market-data-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .market-data-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Converter Pairs Grid (Index pages)
   ============================================ */

.converter-pairs-grid {
    display: grid;
    gap: 0.75rem;
}

.converter-pairs-grid.popular-grid {
    grid-template-columns: repeat(2, 1fr);
}

.converter-pairs-grid.all-pairs-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
    .converter-pairs-grid.popular-grid,
    .converter-pairs-grid.all-pairs-grid {
        grid-template-columns: 1fr;
    }
}

.converter-pair-card {
    display: block;
    background: #1e252f;
    border: 1px solid #404245;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.converter-pair-card:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.3);
    text-decoration: none;
    transform: translateY(-2px);
}

.converter-pair-card.featured {
    background: linear-gradient(135deg, #1e252f 0%, #252d38 100%);
    border-color: rgba(68, 164, 205, 0.3);
}

.converter-pair-card.featured:hover {
    border-color: rgba(255, 107, 107, 0.5);
}

.pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pair-assets {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pair-assets .from-asset {
    font-size: 1rem;
    font-weight: 600;
    color: #f7fff7;
}

.pair-assets i {
    font-size: 0.75rem;
    color: #888;
}

.pair-assets .to-asset {
    font-size: 1rem;
    font-weight: 600;
    color: #44a4cd;
}

.pair-change {
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.pair-change.positive {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.pair-change.negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.pair-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pair-name {
    font-size: 0.8rem;
    color: #888;
}

.pair-rate {
    font-size: 0.85rem;
    color: #ced4da;
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* ============================================
   Exchanges Grid
   ============================================ */

.exchanges-grid {
    display: grid;
    gap: 1rem;
}

.exchange-card {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    background: #1e252f;
    border: 1px solid #404245;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.exchange-card:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.3);
    text-decoration: none;
    transform: translateX(4px);
}

.exchange-logo {
    width: 96px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.exchange-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.exchange-card .exchange-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.exchange-card .exchange-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f7fff7;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    opacity: 1;
}

.exchange-card .exchange-pairs {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
    text-align: left;
}

.exchange-arrow {
    color: #888;
    font-size: 0.875rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.exchange-card:hover .exchange-arrow {
    color: #ff6b6b;
    transform: translateX(4px);
}

/* ============================================
   Search/Filter
   ============================================ */

.pairs-filter {
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    color: #888;
    font-size: 0.9rem;
}

.pairs-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: #161a1f;
    border: 2px solid #404245;
    border-radius: 10px;
    color: #f7fff7;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pairs-search-input::placeholder {
    color: #666;
}

.pairs-search-input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* No results message */
.no-results-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
}

.no-results-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-message p {
    font-size: 1rem;
    margin: 0;
}

/* ============================================
   Related Converters Grid
   ============================================ */

.related-converters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 576px) {
    .related-converters-grid {
        grid-template-columns: 1fr;
    }
}

.related-converter-item {
    display: block;
    background: #1e252f;
    border: 1px solid #404245;
    border-radius: 8px;
    padding: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-converter-item:hover {
    background: rgba(255, 107, 107, 0.08);
    border-color: rgba(255, 107, 107, 0.3);
    text-decoration: none;
    transform: translateX(4px);
}

.related-converter-item .converter-pair {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.related-converter-item .from-asset {
    font-size: 1rem;
    font-weight: 600;
    color: #f7fff7;
}

.related-converter-item i {
    font-size: 0.75rem;
    color: #888;
}

.related-converter-item .to-asset {
    font-size: 1rem;
    font-weight: 600;
    color: #44a4cd;
}

.related-converter-item .converter-rate {
    font-size: 0.85rem;
    color: #888;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.related-converter-item .rate-value {
    font-size: inherit;
    font-weight: 600;
    color: #f7fff7;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 768px) {
    .converter-header {
        padding: 1.25rem;
    }

    .converter-body {
        padding: 1.25rem;
    }

    .rate-value {
        font-size: 1.5rem;
    }

    .converter-input {
        font-size: 1.25rem;
    }

    .converter-quick-amounts {
        padding: 0.875rem 1.25rem;
    }

    .converter-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .rate-display {
        flex-direction: column;
        gap: 0.25rem;
    }

    .converter-asset {
        display: none;
    }

    .converter-actions {
        flex-direction: column;
    }
}

/* ============================================
   Automation CTA Banner
   ============================================ */

.automation-cta-banner {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    background: linear-gradient(135deg, #1e252f 0%, #252d38 100%);
    border: 1px solid #3a3d42;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    position: relative;
    overflow: hidden;
}

.automation-cta-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ff6b6b 0%, #ff8e53 100%);
}

.automation-cta-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    margin-top: 0.125rem;
}

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

.automation-cta-title {
    color: #f7fff7;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.375rem 0;
}

.automation-cta-desc {
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0 0 1rem 0;
}

.automation-cta-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.automation-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: #ff6b6b;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.automation-btn-primary:hover {
    background: #ff5252;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.automation-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #4a4d52;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.automation-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
    color: #fff;
    text-decoration: none;
}

/* Mobile: Fully stacked */
@media (max-width: 576px) {
    .automation-cta-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .automation-cta-icon {
        margin-top: 0;
    }

    .automation-cta-buttons {
        justify-content: center;
        width: 100%;
    }

    .automation-btn-primary,
    .automation-btn-secondary {
        flex: 1;
        min-width: 140px;
    }
}

/* ============================================
   Skeleton Loading Animation
   ============================================ */

.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05) !important;
    color: transparent !important;
    border-radius: 4px;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Skeleton for pair rates */
.pair-rate.skeleton {
    min-width: 120px;
    height: 1.2em;
    display: inline-block;
}

.pair-change.skeleton {
    min-width: 60px;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Skeleton for sidebar badges */
.badge.skeleton {
    min-width: 50px;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Skeleton text inline element */
.skeleton-text {
    display: inline-block;
    height: 1em;
    min-height: 16px;
    vertical-align: middle;
}

/* Skeleton for related converter items */
.related-converter-item.skeleton-item {
    pointer-events: none;
}

.related-converter-item.skeleton-item .converter-pair,
.related-converter-item.skeleton-item .converter-rate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Price update animation */
.pair-rate.updated,
.pair-change.updated,
.badge.updated {
    animation: price-flash 0.3s ease;
}

@keyframes price-flash {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}
