/* Cryptocurrency Prices Section Styles */

.crypto-prices-section {
    padding: 5rem 0;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.crypto-prices-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, transparent 100%);
    opacity: 0.05;
    pointer-events: none;
}

.crypto-prices-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.crypto-prices-header h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.crypto-prices-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.crypto-prices-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.crypto-prices-subtitle .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
}

.crypto-prices-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

/* Ensure 8 items display nicely */
@media (min-width: 1920px) {
    .crypto-prices-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1919px) {
    .crypto-prices-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .crypto-prices-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .crypto-prices-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.crypto-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.crypto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.crypto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.crypto-card:hover::before {
    transform: scaleX(1);
}

.crypto-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.crypto-card.fallback {
    border-color: #ff9800;
}

.crypto-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.crypto-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-inverse);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crypto-info {
    flex: 1;
}

.crypto-name {
    color: var(--secondary-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.crypto-symbol-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-price {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
}

.price-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    width: fit-content;
}

.price-change.positive {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.price-change.negative {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.price-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.crypto-warning {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 152, 0, 0.1);
    border-radius: 8px;
    color: #ff9800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crypto-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.crypto-error i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.crypto-error p {
    font-size: 1.125rem;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            var(--background-alt) 25%,
            var(--background-alt-2) 50%,
            var(--background-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 24px;
    width: 80%;
}

/* Refresh Button */
.crypto-refresh-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: var(--text-inverse);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.crypto-refresh-btn:hover {
    background: var(--primary-color-hover);
    transform: rotate(180deg) scale(1.1);
}

.crypto-refresh-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.crypto-refresh-btn.loading {
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .crypto-prices-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .crypto-prices-section {
        padding: 3rem 0;
    }

    .crypto-prices-header h2 {
        font-size: 2rem;
    }

    .crypto-prices-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .crypto-refresh-btn {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem auto;
        display: block;
    }

    .crypto-card {
        padding: 1.25rem;
    }

    .price-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .crypto-header {
        flex-direction: column;
        text-align: center;
    }

    .crypto-icon {
        margin: 0 auto;
    }
}

/* Animation for price updates */
@keyframes priceUpdate {
    0% {
        background-color: var(--primary-color);
    }

    50% {
        background-color: var(--primary-color-hover);
    }

    100% {
        background-color: transparent;
    }
}

.crypto-card.price-updated {
    animation: priceUpdate 0.5s ease;
}