:root {
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --accent-color: #3f51b5;
    --positive-color: #4caf50;
    --negative-color: #f44336;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--accent-color);
    color: white;
    padding: 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

nav h1 {
    margin: 0;
    font-size: 1.5rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Refresh Data Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2c3e8c;
    list-style: none;
    padding: 5px 0;
    margin: 0;
    min-width: 180px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-menu li {
    margin: 0;
}

.dropdown-btn {
    background: none;
    border: none;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 15px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Roboto', sans-serif;
}

.dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: none;
}

h1,
h2,
h3 {
    margin: 0 0 15px 0;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.price {
    font-size: 1.5em;
    font-weight: bold;
    margin: 10px 0;
}

.change {
    font-size: 1.1em;
    font-weight: 500;
}

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

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

.chart-section {
    margin-top: 40px;
}

.chart-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chart-container img,
.chart-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.chart-item {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    color: #888;
}

/* Log Colors */
.log-error {
    color: #dc2626;
    /* Red */
    font-weight: bold;
}

.log-warning {
    color: #d97706;
    /* Orange/Dark Yellow */
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: row;
        /* Keep row direction for header bar */
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        position: relative;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        background-color: var(--accent-color);
        position: absolute;
        top: 60px;
        /* Adjust based on header height */
        left: 0;
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        max-height: 500px;
        /* Large enough to fit menu */
        padding-bottom: 20px;
    }

    .nav-menu li {
        text-align: center;
        margin: 3px 0;
    }

    .nav-menu li a {
        display: block;
        width: 100%;
    }

    /* Dropdown on mobile: always visible in expanded menu */
    .nav-dropdown .dropdown-menu {
        position: static;
        display: block;
        background-color: transparent;
        box-shadow: none;
        min-width: auto;
        padding: 0;
    }

    .dropdown-toggle {
        display: none;
    }

    .dropdown-btn {
        text-align: center;
    }

    /* Hamburger Menu */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
    }

    .menu-toggle .bar {
        width: 25px;
        height: 3px;
        background-color: white;
        margin: 4px 0;
        transition: 0.3s;
    }

    /* Analyze Page Table responsiveness */
    .styled-table,
    .quarterly-table {
        font-size: 0.7rem;
        /* Smaller font for mobile */
    }

    .styled-table th,
    .styled-table td,
    .quarterly-table th,
    .quarterly-table td {
        padding: 4px 6px;
        /* Tighter padding */
    }

    .container {
        padding: 0 10px;
        /* Reduce container padding on mobile */
    }

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

    .summary-grid {
        grid-template-columns: 1fr;
        /* Stack summary cards on very small screens */
    }
}

/* Adjust Chart Grid for Desktop to be 2 columns if space allows */
@media (min-width: 769px) {
    /* .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    } */
}

/* Table Responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}