/* Custom CSS for CryptoTracker */


/* Color Variables */
:root {
    --bg-dark: #0a0e1b;
    --bg-card: #1a1f2e;
    --success-color: #00d467;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #3742fa;
    --text-light: #e0e6ed;
    --text-muted: #9ca3af;
    --border-color: #2d3748;
}

/* Global Styles */
body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    color: var(--text-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Custom Dark Theme */
.bg-dark-custom {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color);
}

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(10, 14, 27, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--success-color) !important;
}

/* Cards */
.card {
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 103, 0.2);
}

.card-header {
    border-bottom: 2px solid var(--success-color);
    font-weight: bold;
}

/* Buttons */
.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-success {
    background: linear-gradient(45deg, var(--success-color), #00b458);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(45deg, #00b458, var(--success-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 103, 0.4);
}

.btn-outline-success {
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: #000;
}

/* Forms */
.form-control {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 10px;
}

.form-control:focus {
    background-color: var(--bg-card);
    border-color: var(--success-color);
    color: var(--text-light);
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 103, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Tables */
.table-dark {
    --bs-table-bg: var(--bg-card);
    background-color: var(--bg-card);
}

.table-dark th {
    border-color: var(--border-color);
    background-color: rgba(0, 212, 103, 0.1);
    color: var(--success-color);
    font-weight: bold;
}

.table-dark td {
    border-color: var(--border-color);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 212, 103, 0.1);
}

/* Price Change Indicators */
.price-up {
    color: var(--success-color) !important;
}

.price-down {
    color: var(--danger-color) !important;
}

.price-neutral {
    color: var(--text-muted) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(0, 212, 103, 0.1) 0%, rgba(26, 31, 46, 0.8) 100%);
    border-radius: 20px;
    padding: 2rem;
}

/* Crypto Ticker */
.crypto-ticker {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    overflow: hidden;
}

.ticker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticker-item-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 12px;
    background: rgba(0, 212, 103, 0.1);
    border-radius: 8px;
    margin: 0 2px;
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    line-height: 1.2;
}

.ticker-item-grid strong {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.ticker-item {
    display: inline-block;
    margin-right: 30px;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
}

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

/* Responsive ticker */
@media (max-width: 768px) {
    .ticker-item-grid {
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .ticker-item-grid strong {
        font-size: 0.8rem;
    }
    
    .ticker-row {
        margin-bottom: 6px;
    }
}

/* News Cards */
.news-card {
    transition: all 0.3s ease;
    margin-bottom: 15px;
    min-height: 140px;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 103, 0.15);
}

.news-image {
    height: 200px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.news-image-compact {
    height: 120px;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
}

.news-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.news-title {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title:hover {
    color: var(--success-color);
    text-decoration: none;
}

/* Compact news layout */
.news-container .row {
    margin-left: -8px;
    margin-right: -8px;
}

.news-container .col-lg-6 {
    padding-left: 8px;
    padding-right: 8px;
}

/* Better spacing for news cards */
@media (min-width: 992px) {
    .news-card .card-body {
        padding: 0.75rem !important;
    }
    
    .news-card .card-title {
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .news-card .card-text {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Portfolio Charts */
#portfolio-chart {
    max-width: 100%;
    height: auto;
}

/* Loading Spinner */
.loading-spinner {
    padding: 3rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Ad Containers */
.ad-container {
    padding: 10px 0;
    margin: 15px 0;
}

.ad-space {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-space:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--success-color);
}


.ad-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: center;
}

/* Adsterra Specific Styling */
.ad-space iframe {
    border-radius: 8px;
    max-width: 100%;
    max-height: 100%;
}

.ad-space script {
    width: 100%;
    height: 100%;
}

/* Fallback Ad Styling */
.ad-space .fallback-ad {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    width: 100%;
}

.ad-space .fallback-ad i {
    color: var(--success-color);
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.ad-space .fallback-ad h6 {
    color: var(--text-light);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.ad-space .fallback-ad p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Ad Loading Animation */
.ad-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
}

.ad-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 2px;
}

/* Native Ad Styling */
.native-ad-container {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

/* Mobile Ad Responsiveness */
@media (max-width: 768px) {
    .ad-space {
        max-width: 100%;
        height: auto;
        min-height: 60px;
        margin: 8px auto;
    }
    
    
    .sidebar-ad {
        width: 100%;
        height: 200px;
        max-width: 300px;
    }
    
    .ad-container {
        padding: 8px 0;
        margin: 10px 0;
    }
    
    .ad-space .fallback-ad {
        padding: 15px;
    }
    
    .ad-space .fallback-ad i {
        font-size: 1.5rem;
    }
}

/* AdBlock Detection Message */
.adblock-message {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    color: var(--text-light);
    margin: 10px 0;
}

.adblock-message i {
    color: #ffc107;
    font-size: 1.2rem;
    margin-right: 8px;
}

/* Ad Revenue Optimization */
.ad-space[data-loaded="true"] {
    border: 1px solid transparent;
    background: transparent;
}

.ad-space[data-error="true"] {
    border-color: rgba(255, 71, 87, 0.3);
    background: rgba(255, 71, 87, 0.05);
}

/* Portfolio Summary Cards */
.portfolio-summary .card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 212, 103, 0.1) 100%);
}

/* Market Stats */
.market-stat {
    text-align: center;
    padding: 1rem;
}

.market-stat i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Crypto Logo */
.crypto-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Alert Badges */
.alert-badge {
    position: relative;
    top: -2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .ad-space {
        max-width: 100%;
        height: auto;
        min-height: 60px;
    }
    
    .crypto-ticker {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--success-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00b458;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* DataTables Custom Styling */
.dataTables_wrapper .dataTables_filter input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 5px;
}

.dataTables_wrapper .dataTables_length select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 5px;
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-light);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--success-color);
    color: #000;
}

/* Social Links */
.social-links a {
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--text-light) !important;
    transform: scale(1.1);
}

/* Utility Classes */
.text-success-custom {
    color: var(--success-color) !important;
}

.bg-success-custom {
    background-color: var(--success-color) !important;
}

.border-success-custom {
    border-color: var(--success-color) !important;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Featured Crypto Cards */
.featured-crypto {
    background: linear-gradient(135deg, rgba(0, 212, 103, 0.1) 0%, var(--bg-card) 100%);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 212, 103, 0.3);
}

/* Cache Control Headers */
.no-cache {
    cache-control: no-cache, no-store, must-revalidate;
    pragma: no-cache;
    expires: 0;
}

/* Advertisement Containers */
.header-ad-container {
    background-color: rgba(26, 31, 46, 0.8);
    margin-top: 70px; /* Account for fixed navbar */
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-ad-space {
    width: 728px;
    height: 90px;
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.footer-ad-container {
    background-color: rgba(26, 31, 46, 0.8);
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
}

.footer-ad-space {
    width: 300px;
    height: 250px;
    max-width: 100%;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Responsive Ad Containers */
@media (max-width: 768px) {
    .header-ad-space {
        width: 100%;
        max-width: 320px;
        height: 100px;
    }
    
    .footer-ad-space {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }
}