/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    background-color: #e7e7e7;
    margin: 0;
    padding: 0;
    color: #333;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

.new_line {
    flex-basis: 100%;
    display: flex;
    justify-content: center;
}

/* Navbar */
.navbar {
    background-color: #104F55;
    color: #fff;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

/* Main Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
}

/* Results Page Layout */
.results-page {
    display: grid;
    grid-template-columns: (4, 1fr); /* Single column for small screens */
    gap: 20px;
    width: 100%;
    max-width: 1800;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Card Styles */
.card, .wide-card, .results-description-card, .results-details-card, .results-stock-card, .results-key-personnel-card {
    width: 90%;
    max-width: 600px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s ease-in-out;
    margin-top:30px;
    margin-bottom: 20px;
    background-color: #fff;
    color: #333;
    box-sizing: border-box;
}

/* Full-width top summary card */
.card.summary-card {
    width: 100%;
    max-width: none;
    text-align: left;
}

/* Ensure results cards are flexible */
.results-description-card, .results-details-card, .results-stock-card, .results-key-personnel-card {
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    max-height: 500px;
    overflow-y: auto;
    margin: 0 auto;
    text-align: left;
}

.card-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.card-row .card {
    flex: 1 1 300px;
    max-width: 350px;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    text-align: center;
}

.card .button {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: #643b50;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.card .button:hover {
    background-color: #522e41;
}



/* Centered Table Styling */
.centered-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 10px 0;
}
.centered-table th, .centered-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    white-space: nowrap;
}
.centered-table th {
    background-color: #104F55;
    color: white;
}
.centered-table tbody tr:hover {
    background-color: #f5f5f5;
}

/* Adjust name column for flexible width without excessive wrapping */
.name-column {
    white-space: nowrap;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #704C5E;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease-in-out;
    border: 2px solid transparent;
    box-sizing: border-box;
}
.button:hover {
    background-color: #704C5E;
    border: 2px solid #fff;
}

/* Home Button */
.home-button {
    display: block;
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

/* Footer */
.footer {
    background-color: #104F55;
    color: white;
    text-align: center;
    padding: 20px;
    position: relative;
    bottom: 0;
    width: 100%;
    font-size: 14px;
}



/* Responsive Design */
@media (min-width: 428px) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .results-page {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .card {
        width: 30%;
        margin: 10px;
    }
}

/* Stock Chart Styling */
.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    text-align: center;
}

.chart-container img {
    max-width: 100%;
    height: auto;
}

.chart-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    text-align: center;
    margin-bottom: 20px;
}
.chart-controls .button {
    margin: 5px;
    padding: 10px 15px;
    background-color: #104F55;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}
.chart-controls .button:hover {
    background-color: #0c3a3f;
}




/* Styling for the Financial Analysis Charting */
.toggle-content.hidden {
  display: none;
}

.toggle-icon.rotate {
  transform: rotate(-90deg);
}


/* styling for the company comparison page */

body {
  font-family: 'Roboto', sans-serif;
  background-color: #eeeeee;
  color: #222;
}

.container.comparison-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: block;
  gap: 2rem;
}

.metric-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.5rem;
  width: 90%;
  max-width: 1000px;
  box-sizing: border-box;
  margin: 20px auto;
}

.metric-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.centered-table {
  width: 100%;
  border-collapse: collapse;
}

.centered-table th,
.centered-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

.centered-table th {
  background-color: #f9f9f9;
  font-weight: 500;
  color: #333;
}

form.form-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}

select {
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
}

canvas {
  margin-top: 1rem;
  max-height: 300px;
}

/* Boethius styling */
.metric-card .input-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 15px;
}

.metric-card textarea {
  width: 100%;
  padding: 10px;
  resize: vertical;
  min-height: 60px;
  border-radius: var(--radius);
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 0.8rem;
 }


.metric-card textarea: focus {
  resize: none;
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.left-button-item {
  display: flex;
  align-items: center; 
  gap: 8px;
}

.right-button-item {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;
}

.metric-card button {
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid #aaa;
  background-color: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
}

.conversationContainer {
  max-height: 300px;
  overflow-y: scroll;
}


/* Responsive styling */
@media (max-width: 1280px) {
    .results-page {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Mobile Fixes */
@media (max-width: 600px) {
    .results-page {
        grid-template-columns: 1fr;
    }
    .card {
        width: 95%;
        max-width: 100%;
    }
}


/* --- Summary Card (top of company page) ------------------------------ */

.summary-card {
  width: 100%;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.summary-title {
  margin: 0;
}

.summary-sub {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 4px;
}

.summary-warning {
  font-size: 0.9rem;
  padding: 6px 10px;
  border: 1px solid #c9792a;
  border-radius: 6px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-block .label {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 6px;
}

.summary-block .big {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
}

.summary-block .small {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 1200px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-warning {
    white-space: normal;
  }
}

@media (max-width: 650px) {
  .summary-header {
    flex-direction: column;
    align-items: stretch;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
}


/* --- Homepage layout ------------------------------------------------ */

.homepage-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1400px;
    margin: 30px auto;
    align-items: start;
    box-sizing: border-box;
}

.homepage-left,
.homepage-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-title {
    width: 100%;
    max-width: 1400px;
    margin: 30px auto 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

.page-title h1 {
    margin-bottom: 10px;
}

.page-title .subtitle {
    max-width: 900px;
    line-height: 1.6;
}

/* Performance cards on homepage */
.performance-card {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
}

.performance-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

/* Right-hand homepage cards */
.homepage-right .home-card {
    width: 100%;
    max-width: none;
    margin: 0;
    text-align: left;
}

.homepage-right .home-card h3 {
    margin-top: 0;
}

.homepage-right .home-card .button {
    margin-top: 16px;
}

/* Performance tables */
.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.performance-table th,
.performance-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
}

.performance-table th {
    background-color: #104F55;
    color: #fff;
    font-weight: 500;
}

.performance-table tbody tr:hover {
    background-color: #f7f7f7;
}

/* Responsive homepage */
@media (max-width: 1000px) {
    .homepage-layout {
        grid-template-columns: 1fr;
    }
}


.thesis-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.thesis-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.thesis-tab {
    border: 1px solid #d9d9d9;
    background: #f5f5f5;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
}

.thesis-tab.active {
    background: #ffffff;
    border-color: #999;
    font-weight: 500;
}

.thesis-panel {
    display: none;
}

.thesis-panel.active {
    display: block;
}

.toggle-rows-btn {
    margin-top: 10px;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mini-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mini-toggle-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: #666;
    border-bottom: 1px solid transparent;
}

.mini-toggle-btn.active {
    color: #111;
    font-weight: 500;
    border-bottom: 1px solid #999;
}

.toggle-panel {
    display: none;
}

.toggle-panel.active {
    display: block;
}

.thesis-card {
    margin-top: 20px;
    margin-left: 0;
}

.logout-form {
    display: inline;
    margin: 0;
}

.logout-link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}


.auth-page {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.auth-heading {
    margin-bottom: 1.5rem;
}

.auth-heading h1 {
    margin: 0 0 0.4rem;
    font-size: 1.7rem;
    font-weight: 500;
}

.auth-heading p {
    margin: 0;
    color: #666666;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    font: inherit;
    background: #fafafa;
}

.auth-field input:focus {
    outline: none;
    border-color: #555555;
    background: #ffffff;
}

.auth-submit {
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 4px;
    background: #333333;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.auth-submit:hover {
    background: #111111;
}

.auth-error {
    margin-bottom: 1.2rem;
    padding: 0.75rem;
    border-left: 3px solid #9b2c2c;
    background: #f8eeee;
    color: #6f2020;
    font-size: 0.9rem;
}