/* Simple CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}
body, h1, h2, p, ul, ol, li, table, th, td, button, pre {
  margin: 0;
  padding: 0;
}
html, body {
  min-height: 100vh; /* Ensure body takes full viewport height */
  overflow-x: hidden; /* Prevent horizontal scrolling on overflow */
}
html {
  -webkit-text-size-adjust: 100%; /* Prevent font size changes on orientation change */
}


body {
    font-family: Arial, sans-serif;
    background-color: #232A15;
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers content horizontally */
}
h1 {
    color: #4CAF50;
    text-align: center;
}
h2 {
    color: #4CAF50;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #333 !important; /* Added !important */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-top: 20px; /* Add some space above the table */
    table-layout: auto; /* Allow column widths to be determined by content */
    min-width: 0; /* Allow table to shrink as much as needed */
    margin-left: auto; /* Explicitly center table within scrollable div */
    margin-right: auto; /* Explicitly center table within scrollable div */
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #555 !important; /* Added !important */
    /* Removed word-wrap and overflow-wrap to prevent aggressive text wrapping */
}

.stock-name {
    white-space: nowrap; /* Prevent wrapping */
    max-width: 150px; /* Constrain width */
    overflow: hidden; /* Hide overflow content */
    text-overflow: ellipsis; /* Show ellipsis for truncated text */
    display: inline-block; /* Required for text-overflow to work */
    position: relative; /* For z-index to work */
    z-index: 0; /* Default z-index */
}

.stock-name:hover {
    overflow: visible; /* Show full content on hover */
    white-space: normal; /* Allow text to wrap if necessary */
    background-color: #444; /* Highlight background on hover */
    z-index: 1; /* Bring to front on hover */
    max-width: none; /* Allow full width on hover */
}

th {
    background-color: #4CAF50 !important;
    color: white;
    text-align: center;
}

/* Center align specific numeric/date columns in the table body */
.sortable td:nth-child(1), /* # column */
.sortable td:nth-child(4), /* Price column */
.sortable td:nth-child(5), /* Change column */
.sortable td:nth-child(6), /* Change % column */
.sortable td:nth-child(7)  /* Date column */
{
    text-align: center;
}

tr:nth-child(even) {
    background-color: #444 !important; /* Added !important */
}
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}
.gallery img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 0; /* Allow images to shrink as much as needed */
}
button, .results-link a, .go-back-button {
    background-color: #4CAF50;
    color: white;
    padding: 0 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    height: 35px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    vertical-align: middle;
    margin: 5px; /* Ensure space even if gap fails */
}

.results-link {
    text-align: center;
    margin-bottom: 10px;
}

.results-link a, .go-back-button {
    min-width: 150px;
}

button:hover, .results-link a:hover, .go-back-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    color: white;
}

button:active, .results-link a:active, .go-back-button:active {
    transform: translateY(0);
}

pre {
    background-color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 90%;
    max-width: 800px;
    height: 5em; /* Approximately 3 lines of text */
    overflow-y: auto;
    border: 1px solid #555;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #eee;
    text-align: left;
}

.ticker-input {
    padding: 15px 10px;
    margin-right: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    font-size: 16px; /* Match button font size */
    vertical-align: top; /* Align with button */
}

.centered-button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.dark-green-text {
    color: #006400; /* Dark Green */
}

/* Change Indicators (dots) */
.change-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.change-indicator.up {
    background-color: #28a745; /* Green */
}

.change-indicator.down {
    background-color: #dc3545; /* Red */
}

.change-indicator.no-change {
    background-color: #6c757d; /* Gray */
}

/* Text for increased price (greenish) */
.price-up {
    color: #28a745; /* Green */
}

/* Report Box Styles */
.report-box {
    background-color: #333; /* Dark background */
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 800px; /* Limit width to look good */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    box-sizing: border-box;
    overflow-x: auto;
}

.report-box h3 {
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.report-box ul {
    list-style: none; /* Remove bullet points */
    padding: 0;
    margin: 0;
}

.report-box li {
    margin-bottom: 5px;
    font-size: 0.95em;
    /* Optional: display: flex; justify-content: space-between; align-items: center; if content varies much */
}

.report-box li span {
    font-weight: bold;
}

.price-down {
    color: #dc3545; /* Red */
}

.weight-down {
    color: #dc3545; /* Red */
}

.weight-up {
    color: #28a745; /* Green */
}

.container {
    max-width: 1200px;
    width: 100%; /* Ensure it always takes 100% of parent width up to max-width */
    margin: auto;
    padding: 0 20px; /* Add some padding on the sides */
}

.container p {
    text-align: center;
}

.table-responsive {
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    margin-bottom: 20px; /* Add some space below the table for better readability */
}

@media (max-width: 480px) { /* For screens smaller than 480px */
    .container {
        padding: 0 10px; /* Reduce padding on very small screens */
    }
    .gallery img {
        max-width: 90%; /* Further restrict image width on small screens */
    }
}

/* Table sorting indicator styles */
th[data-sort]:after {
    content: '';
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid white; /* Default arrow pointing up (ascending) */
    transition: transform 0.2s ease;
}

th[data-sort='desc']:after {
    transform: rotate(180deg); /* Arrow pointing down (descending) */
}

th[data-sort='asc']:after {
    transform: rotate(0deg); /* Arrow pointing up (ascending) */
}
/* Styles moved from index.html */
.clock-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.clock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.clock {
    font-size: 2em; /* Larger font */
    color: #fff; /* White text */
    background-color: #333; /* Dark background */
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    min-width: 200px;
    text-align: center;
}

.timezone-label {
    font-size: 1.2em; /* Larger font */
    color: #ccc; /* Light grey text */
    margin-bottom: 5px;
}

hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 5px auto;
    width: 60%;
    max-width: 800px;
}

.summary {
    text-align: center;
    margin: 30px 0;
}

/* Styles for alpha/index.html to match the main theme */
.container-alpha {
    max-width: 900px;
    margin: auto;
    background: #333; /* Dark background */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Darker shadow */
    color: #fff; /* White text for container content */
    width: 100%; /* Ensure container takes available width */
    box-sizing: border-box; /* Include padding in width calculation */
}
h2 {
    color: #4CAF50; /* Green color for consistency */
}
.input-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: separate;
    border-spacing: 0;
    background-color: transparent !important;
    box-shadow: none !important;
    margin-top: 0 !important;
}

.input-table td {
    padding: 5px;
    vertical-align: middle;
    border-bottom: none !important; /* Override general table style */
    text-align: center;
}

.input-table label {
    color: #ccc;
    margin-right: 10px;
}

.input-table input[type="text"] {
    padding: 15px 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #444;
    color: #fff;
    font-size: 16px;
    width: 100%; /* Make input box fill the cell */
    min-width: 200px; /* Match button min-width */
}

/* Specific alignment for table cells */
.input-table tr:first-child td:nth-child(1) { text-align: left; width: auto; }
.input-table tr:first-child td:nth-child(2) { width: 50%; }
.input-table tr:first-child td:nth-child(3) { text-align: left; width: auto; }

#no-data-message td {
    text-align: center;
    padding-top: 10px;
}

#no-data-message-text {
    text-align: left !important;
}

#no-data-message-buttons {
    text-align: left;
}

/* Buttons are already styled by the general 'button' rule in index.css */

.quote-display {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #4CAF50; /* Green border */
    border-radius: 5px;
    background-color: #282828; /* Darker background */
    color: #fff; /* White text */
}
.quote-display p {
    margin: 0;
    font-size: 1.1em;
    color: #fff; /* White text */
}
.quote-display .symbol {
    font-weight: bold;
    font-size: 1.2em;
    color: #4CAF50; /* Green for symbol */
}
.chart-container {
    position: relative;
    height: 350px; /* Adjust height to 350px */
    margin-bottom: 20px;
    background-color: white; /* White background for the graph area */
    border: 1px solid #4CAF50; /* Green border like the quote-display */
    border-radius: 8px; /* Slightly rounded corners for the box */
}
#console-output {
    background-color: #282828; /* Darker background */
    color: #eee;
    padding: 10px;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    border: 1px solid #444; /* Darker border */
}

.alpha-logo-link {
    display: flex; /* Use flexbox */
    justify-content: flex-end; /* Align items to the right */
    margin-top: 15px; /* Add some space above the logo/link */
    margin-bottom: 15px;
    width: 100%; /* Ensure it takes full width to allow right alignment */
    margin-left: auto; /* Push this element to the right in a flex container */
    padding-right: 20px; /* Add some padding from the right edge */
}

@media (max-width: 600px) {
    .input-table td {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px; /* Add space between stacked items */
    }

    .input-table td:last-child {
        margin-bottom: 0; /* Remove margin from the last item */
    }

    .input-table label {
        margin-right: 0; /* Remove right margin on label */
        margin-bottom: 5px; /* Add space below label */
        display: block; /* Ensure label is on its own line */
    }
}

.alpha-button {
    font-size: 24px !important; /* Increase font size for the alpha symbol */
}

#market-status-display {
    width: 80%;
    max-width: 800px;
    margin: 10px 0 20px 0;
    padding: 10px;
    text-align: center;
    font-size: 1.1em;
    border-radius: 5px;
    background-color: #333; /* Default background */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 80%;
    max-width: 800px;
    justify-content: center; /* Center the items */
    margin-top: 20px;
    margin-bottom: 10px;
}

#market-status-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.5s ease;
    background-color: #6c757d; /* Default to unknown */
}

.market-open { background-color: #28a745 !important; }
.market-closed { background-color: #dc3545 !important; }
.market-unknown { background-color: #6c757d !important; }

/* Info Button Style */
.info-button {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #4CAF50; /* Green */
    color: white;
    border-radius: 50%; /* Circle */
    text-align: center;
    line-height: 20px; /* Center text vertically */
    font-weight: bold;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.info-button:hover {
    background-color: #45a049;
    text-decoration: none;
    color: white;
}