/* Home page specific styles */

/* Home Page Card Styles */
.card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.card-header {
    padding: 1.5rem;
    background-color: transparent;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: transparent;
}

/* Crypto List Panel */
.crypto-list-panel .card-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;

}

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

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

.ui-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.search-box input {
    padding-left: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.crypto-list {
    overflow-y: auto;
    max-height: 60vh; /* Use viewport height for better responsiveness */
    min-height: 300px; /* Minimum height on all devices */
    padding-right: 0.5rem;
    width: 100%;
}

.crypto-list::-webkit-scrollbar {
    width: 6px;
}

.crypto-list::-webkit-scrollbar-track {
    background: transparent;
}

.crypto-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

.crypto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.crypto-item:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    border-color: rgba(var(--primary-color-rgb), 0.2);
    transform: translateX(5px);
}

.crypto-item.active {
    background-color: rgba(var(--primary-color-rgb), 0.15);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

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

.crypto-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crypto-icon svg {
    width: 24px;
    height: 24px;
}

.crypto-name {
    font-weight: 500;
}

.crypto-symbol {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.crypto-price {
    font-weight: 600;
}

.crypto-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.crypto-change.positive {
    color: var(--positive-color);
}

.crypto-change.negative {
    color: var(--negative-color);
}

/* Chart Panel */
.chart-panel .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Chart Container - uses the responsive height from common.css */
.chart-container {
    width: 100%;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.price-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

[data-theme="light"] .price-change.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--light-positive);
}

[data-theme="light"] .price-change.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--light-negative);
}

[data-theme="dark"] .price-change.positive {
    background-color: rgba(52, 211, 153, 0.1);
    color: var(--dark-positive);
}

[data-theme="dark"] .price-change.negative {
    background-color: rgba(248, 113, 113, 0.1);
    color: var(--dark-negative);
}

.timeframe-selector {
    display: flex;
    gap: 0.5rem;
}

.btn-timeframe {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-timeframe:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-timeframe.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Footer styles are now in footer.css */

/* Theme toggle styles are now in header.css */

/* Responsive Styles */
@media (max-width: 1200px) {
    .crypto-list {
        max-height: 55vh;
        min-height: 300px;
    }
}

@media (max-width: 992px) {
    .crypto-list {
        max-height: 50vh;
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

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

    .crypto-list {
        max-height: 45vh;
        min-height: 200px;
    }
}

@media (max-width: 576px) {
    .app-header {
        padding: 1.5rem 0;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .chart-panel .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .crypto-list {
        max-height: 40vh;
        min-height: 180px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .crypto-list {
        max-height: 50vh;
        min-height: 150px;
    }
}

/* On the two-column desktop layout the chart panel is the taller card and drives
   the row height. Give the Market Overview list a flex-basis of 0 so its items
   don't push the card taller than the chart panel; it then fills the matched
   height exactly (scrolling if needed) with no empty space in either box. */
@media (min-width: 992px) {
    .crypto-list-panel .card-body {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
    }

    .crypto-list-panel .crypto-list {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
    }
}