/* Historical stock price lookup styles */
.stock-history-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border: none;
    padding: 20px;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

.stock-history-container h2 {
    font-size: 26px;
    font-weight: 700;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    margin: 0 0 20px;
}

.stock-history-container h3 {
    font-size: 20px;
    font-weight: 700;
    color: #333333;
    margin: 20px 0;
}

.historical-lookup-form {
    background: #ffffff;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: none;
}

.historical-lookup-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
    color: #333333;
    font-size: 14px;
}

.historical-lookup-form select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #333333;
}

/* Date selector container - display selectors horizontally */
.date-selector-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
}

.date-selector-container > div {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.date-selector-container > div label {
    margin-bottom: 5px;
}

.date-selector-container > div select {
    width: 100%;
}

.stock-historical-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    background: #ffffff;
    border: none;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.stock-historical-table th,
.stock-historical-table td {
    border: none;
    border-bottom: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.stock-historical-table th {
    background-color: #f2f2f2;
    font-weight: 700;
    color: #333333;
    border-bottom: 2px solid #ddd;
}

.stock-historical-table td {
    color: #666666;
    font-weight: 700;
}

.stock-historical-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.stock-historical-table tr.target-date {
    background-color: #e6f7ff;
    font-weight: 700;
}

.stock-historical-table tr.target-date td {
    font-weight: 700;
}

.stock-historical-table tr:hover {
    background-color: #f5f5f5;
}

.attribution-note {
    font-size: 12px;
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #0073aa;
    font-family: 'Montserrat', sans-serif;
    color: #666666;
}

.attribution-note p {
    margin: 0;
    line-height: 1.5;
}

.attribution-note strong {
    font-weight: 700;
    color: #333333;
}

/* Flash background effect for AJAX updates */
.flash-bg {
    background-color: #ffffd7;
    transition: background-color 0.5s ease;
}

/* Mobile styles for vertical layout */
@media screen and (max-width: 768px) {
    .stock-historical-table,
    .stock-historical-table thead,
    .stock-historical-table tbody,
    .stock-historical-table th,
    .stock-historical-table td,
    .stock-historical-table tr {
        display: block;
    }

    /* Hide table headers for mobile */
    .stock-historical-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    /* Style each row as a mobile card */
    .stock-historical-table tr {
        border: 1px solid #ddd;
        border-radius: 5px;
        margin-bottom: 20px;
        background-color: #fff;
        padding: 15px;
        position: relative;
    }

    /* Style each data cell */
    .stock-historical-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 10px 0;
        text-align: left;
        display: flex;
        justify-content: space-between;
    }

    /* Remove border from last cell */
    .stock-historical-table td:last-child {
        border-bottom: none;
    }

    /* Add labels for each data point */
    .stock-historical-table td:nth-child(1):before {
        content: "Date";
        font-weight: bold;
    }

    .stock-historical-table td:nth-child(2):before {
        content: "Closing Price";
        font-weight: bold;
    }

    .stock-historical-table td:nth-child(3):before {
        content: "Volume";
        font-weight: bold;
    }

    .stock-historical-table td:nth-child(4):before {
        content: "Open Price";
        font-weight: bold;
    }

    .stock-historical-table td:nth-child(5):before {
        content: "Day High";
        font-weight: bold;
    }

    .stock-historical-table td:nth-child(6):before {
        content: "Day Low";
        font-weight: bold;
    }

    /* Style the data values */
    .stock-historical-table td:nth-child(2) span,
    .stock-historical-table td:nth-child(3) span,
    .stock-historical-table td:nth-child(4) span,
    .stock-historical-table td:nth-child(5) span {
        font-weight: normal;
    }

    /* Highlight target date row */
    .stock-historical-table tr.target-date {
        background-color: #e6f7ff;
        border: 2px solid #1890ff;
    }

    /* Hover effect for mobile (touch) */
    .stock-historical-table tr:active {
        background-color: #f5f5f5;
    }
}