/* Markets Page Specific Styles */

/* Markets Hero Section */
.markets-hero-section {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.markets-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.markets-header {
    text-align: center;
    position: relative;
    z-index: 2;
}

.markets-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.markets-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

/* Market Stats */
.market-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.stat-value.positive {
    color: #00d4aa;
}

.stat-value.negative {
    color: #e74c3c;
}

/* Market Filters */
.market-filters {
    padding: 2rem 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
}

.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 25px;
    border: 1px solid var(--border-color);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Markets Table Section */
.markets-table-section {
    padding: 2rem 0;
    background: var(--bg-white);
}

.markets-table-container {
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.markets-table {
    margin: 0;
}

.markets-table thead th {
    background: var(--bg-light);
    border: none;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.markets-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.markets-table tbody tr:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.markets-table tbody td {
    padding: 1rem;
    border: none;
    vertical-align: middle;
}

/* Coin Info */
.coin-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.coin-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.8rem;
}

.coin-icon.btc { background: #f7931a; }
.coin-icon.eth { background: #627eea; }
.coin-icon.sol { background: #9945ff; }
.coin-icon.ada { background: #0033ad; }
.coin-icon.dot { background: #e6007a; }
.coin-icon.link { background: #2a5ada; }
.coin-icon.uni { background: #ff007a; }
.coin-icon.aave { background: #b6509e; }

.coin-details h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-dark);
}

.coin-details span {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Price Info */
.price-info {
    display: flex;
    flex-direction: column;
}

.price {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.price-usd {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Change Indicators */
.change {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.change.positive {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.change.negative {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* Volume and Market Cap */
.volume,
.market-cap {
    font-weight: 500;
    color: var(--text-dark);
}

/* Market Categories */
.market-categories {
    padding: 80px 0;
    background: var(--bg-light);
}

.market-categories h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.category-card h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.category-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.category-card .btn {
    border-radius: 25px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* Market News */
.market-news {
    padding: 80px 0;
    background: var(--bg-white);
}

.market-news h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    position: relative;
}

.news-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-placeholder::before {
    content: '📰';
    font-size: 3rem;
}

.news-content {
    padding: 1.5rem;
}

.news-category {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.news-content h5 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.news-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Responsive Design for Markets */
@media (max-width: 991.98px) {
    .markets-header h1 {
        font-size: 2.5rem;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .market-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .markets-header h1 {
        font-size: 2rem;
    }
    
    .markets-header p {
        font-size: 1rem;
    }
    
    .market-stats {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .markets-table {
        font-size: 0.9rem;
    }
    
    .coin-info {
        gap: 0.5rem;
    }
    
    .coin-icon {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
}

@media (max-width: 575.98px) {
    .markets-hero-section {
        padding: 100px 0 40px;
    }
    
    .markets-header h1 {
        font-size: 1.8rem;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .markets-table thead th,
    .markets-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .coin-details h6 {
        font-size: 0.9rem;
    }
    
    .coin-details span {
        font-size: 0.7rem;
    }
    
    .price {
        font-size: 0.9rem;
    }
    
    .price-usd {
        font-size: 0.7rem;
    }
}

/* Market Table Animations */
.market-row {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Price Fluctuation Animation */
.price {
    transition: color 0.3s ease;
}

.price.updating {
    animation: priceUpdate 0.5s ease;
}

@keyframes priceUpdate {
    0%, 100% { color: var(--text-dark); }
    50% { color: var(--primary-color); }
}

/* Loading States */
.markets-table-container.loading {
    position: relative;
    min-height: 400px;
}

.markets-table-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Market Categories Hover Effects */
.category-card:hover .category-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* News Card Hover Effects */
.news-card:hover .news-image {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Filter Button Active States */
.filter-buttons .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search Box Focus Effects */
.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 170, 0.25);
}

/* Table Row Selection */
.market-row.selected {
    background: rgba(0, 212, 170, 0.1) !important;
    border-left: 4px solid var(--primary-color);
}

/* Responsive Table */
@media (max-width: 768px) {
    .markets-table {
        display: block;
        overflow-x: auto;
    }
    
    .markets-table thead,
    .markets-table tbody,
    .markets-table tr,
    .markets-table th,
    .markets-table td {
        display: block;
    }
    
    .markets-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .markets-table tr {
        border: 1px solid var(--border-color);
        margin-bottom: 1rem;
        border-radius: 10px;
        padding: 1rem;
    }
    
    .markets-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: left;
    }
    
    .markets-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: var(--text-light);
    }
} 