/* Module container */
.module-container {
    padding: 20px;
    line-height: 1.6;
}

/* Logo styling */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo-container img {
    width: 60px;
    height: auto;
}

/* Live mode toggle */
.live-mode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Content container */
#content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 90%;
    margin: 0 auto;
    border-radius: 10px;
    padding: 20px;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Date selection */
#date-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

#date-selection input {
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    width: 150px;
}

/* Reset zoom button */
#reset-zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

#reset-zoom-button:hover {
    background-color: #218838;
}

/* Chart and legend container */
#chart-and-legend {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px;
}

/* Legend container */
#legend-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 10px;
    width: 250px;
    min-width: 200px;
    box-sizing: border-box;
    background-color: white;
}

#legend-search {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 5px;
}

.legend-item input {
    margin-right: 8px;
    flex-shrink: 0;
    width: 20px;
}


.legend-item label {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.legend-button {
    margin: 5px;
    padding: 5px 10px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.legend-button:hover {
    background-color: #0056b3;
}

.hidden-label {
    text-decoration: line-through;
    color: #aaa;
}

/* Chart container */
#chart-container {
    flex-grow: 1;
    min-width: 400px;
    max-width: calc(100% - 270px);
    position: relative;
}

canvas {
    width: 100% !important;
    max-width: 100%;
    height: 500px !important;
}

/* Button group */
.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

/* Highlights section */
#highlights-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.highlight-card {
    width: 250px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.highlight-card h3 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.highlight-card h4 {
    text-align: center;
    margin: 10px 0;
}

.highlight-card .positive-brokers h4 {
    color: var(--success-color);
}

.highlight-card .negative-brokers h4 {
    color: var(--danger-color);
}

.highlight-card table {
    width: 100%;
    border-collapse: collapse;
}

.highlight-card th {
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    padding: 5px;
}

.highlight-card th:last-child {
    text-align: right;
}

.wide-card {
    width: 350px;
}

.top5-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Contact section */
.contact-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
    padding: 20px;
}

.contact-section h2 {
    color: #343a40;
    margin-bottom: 10px;
}

.contact-section p {
    color: #6c757d;
    font-size: 16px;
    max-width: 600px;
    margin: 10px auto;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 800px) {
    #chart-and-legend {
        flex-direction: column;
        align-items: center;
    }
    
    #chart-container {
        max-width: 100%;
    }
    
    #legend-container {
        width: 100%;
        max-width: 100%;
    }
    
    .highlight-card {
        width: 100%;
        max-width: 300px;
    }
    
    .wide-card {
        width: 100%;
        max-width: 350px;
    }
}