﻿/* --- 1. ZÁKLADNÍ NASTAVENÍ A LAYOUT --- */
html {
    font-size: 14px;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Montserrat', sans-serif;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: #fff;
}

header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-content {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    padding: 20px 0;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

/* --- 2. PORTFOLIO LIST (STRUKTURA) --- */
.portfolio-list {
    display: flex;
    flex-direction: column;
}

.asset-row {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.asset-main {
    display: flex;
    align-items: center;
    padding: 12px 5px;
    gap: 12px;
    cursor: pointer;
}

    .asset-main:hover {
        background-color: #fafafa;
    }

/* --- 3. SLOUPCE V ŘÁDKU --- */
.asset-info {
    flex: 1; /* Název firmy zabere zbytek místa a odtlačí ceny doprava */
    min-width: 0;
}

.company-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #222;
    display: block;
}

.ticker-sub {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
}

.asset-prices {
    text-align: right;
    min-width: 90px;
}

.current-price {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.avg-price {
    font-size: 0.8rem;
    color: #999;
}

.asset-stats {
    min-width: 70px;
    text-align: right;
}

.pl {
    font-weight: 600;
    font-size: 0.95rem;
}

.pos {
    color: #28a745;
}

.neg {
    color: #dc3545;
}

/* --- 4. TLAČÍTKO ŠIPKY (S RÁMEČKEM) --- */
.asset-expand {
    flex: 0 0 auto;
}

.expand-mobile {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* Zabezpečíme, že se točí jen vnitřek, ne ten rámeček */
.toggle-icon {
    transition: transform 0.3s ease-in-out;
    display: inline-block; /* Důležité pro správnou rotaci */
}

/* Varianta A: Třídu 'expanded' dostane celý řádek (lepší pro JS) */
.asset-row.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Varianta B: Třídu 'expanded' dostane přímo ikona (pro jistotu) */
.toggle-icon.expanded {
    transform: rotate(180deg);
}

/* --- 5. DETAIL A GRAF --- */
.asset-details {
    padding-bottom: 20px;
    background-color: #fff;
}

.chart-controls {
    display: flex;
    justify-content: flex-end;
    /* Změníme padding: na pravé straně dáme 5px, aby to lícovalo s .asset-main */
    padding: 10px 0 0 0;
    background-color: transparent; /* Nebo barva pozadí tvého řádku */
}

.timeframe-selector {
    display: flex;
    gap: 2px;
    background: #f0f0f0;
    padding: 3px;
    border-radius: 8px;
}

.tf-btn {
    border: none;
    background: transparent;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
}

.tf-btn.active {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#enable-notifications-btn {
    transition: color 0.3s ease;
    font-weight: 500;
}

#enable-notifications-btn:hover {
    color: #44aa00 !important;
    background: transparent;
}

#enable-notifications-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Mezera mezi ikonou a textem */
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #444;
    text-decoration: none;
}

#enable-notifications-btn:hover {
    color: #34495e;
    transform: translateY(-1px);
}





/* Styl pro loader (rotující spinner) */
.fa-spin {
    font-size: 16px;
}

/* --- 6. MOBILNÍ SPECIFIKA (POD 576px) --- */
@media (max-width: 576px) {
    /* Edge-to-edge list */
    .portfolio-list {
        margin-left: -15px;
        margin-right: -15px;
    }

    .asset-row {
        padding-left: 7px;
        padding-right: 7px;
    }

    .asset-main {
        padding: 12px 0px;
        flex-wrap: nowrap; /* Držíme vše v jedné lince */
    }

    /* Šipka na mobilu - zachování rámečku */
    .expand-mobile {
        background-color: #fff;
        border-color: #ccc;
    }
}

/* --- 7. NAVIGACE (OFFCANVAS) --- */
@media (max-width: 991px) {
    .offcanvas-body {
        padding: 0;
    }

    .navbar-nav .nav-link {
        padding: 15px 20px !important;
        border-bottom: 1px solid #eee;
        font-weight: 500;
    }
}
