:root {
    --primary-color: #1a73e8;
    --primary-hover: #1765cc;
    --secondary-color: #f8f9fa;
    --text-color: #202124;
    --border-color: #dadce0;
    --error-color: #d93025;
    --success-color: #188038;
    --shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --card-radius: 8px;
    --input-radius: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: #f1f3f4;
    line-height: 1.5;
    padding: 20px;
}

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

h1, h2, h3 {
    font-family: 'Google Sans', sans-serif;
    margin-bottom: 16px;
}

h1 {
    font-size: 28px;
    font-weight: 500;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.card {
    background-color: white;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    margin-bottom: 0;
    font-size: 20px;
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 16px;
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--input-radius);
    font-size: 16px;
    transition: border-color 0.2s;
    min-width: 200px;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group {
    position: relative;
    width: 100%;
}

.input-group input {
    padding-right: 40px;
}

.input-group::after {
    content: attr(data-suffix);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 14px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-family: 'Google Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

.button-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    margin-bottom: 16px;
}

.results {
    display: none;
}

.results.active {
    display: block;
}

.result-card {
    background-color: white;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 500;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.result-item {
    margin-bottom: 12px;
}

.result-label {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 4px;
}

.result-value {
    font-size: 16px;
    font-weight: 500;
}

.comparison-result {
    text-align: center;
    padding: 24px;
    margin-top: 24px;
    background-color: #e8f0fe;
    border-radius: var(--card-radius);
}

.comparison-result h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.comparison-value {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 12px;
}

.comparison-text {
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #5f6368;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    margin-left: 4px;
    cursor: help;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 1100px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}

/* Update media queries for form grid */
@media (min-width: 1200px) {
    .form-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on very large screens */
    }
}

@media (max-width: 1199px) and (min-width: 900px) {
    .form-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on large screens */
    }
}

@media (max-width: 899px) and (min-width: 600px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on medium screens */
    }
}

@media (max-width: 599px) {
    .form-grid {
        grid-template-columns: 1fr; /* 1 column on small screens */
    }
}

/* Styles from the HTML file */
.section-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 24px 0 16px 0;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h4 {
  font-family: 'Google Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--primary-color);
}

.positive-value {
  color: #34a853; /* Google green */
}

.negative-value {
  color: #ea4335; /* Google red */
}

/* Add more rounded corners to input fields and adjust width */
input[type="number"] {
  border-radius: 20px;
  padding: 10px 16px;
  width: 200px; /* Increased to 200px as requested */
  max-width: 100%;
  text-align: center; /* Center the text */
  box-sizing: border-box;
}

/* Ensure input group properly contains the input and suffix */
.input-group {
  display: flex;
  align-items: center;
  position: relative;
  width: fit-content;
}

/* Style for the suffix to ensure it doesn't overlap with input text */
.input-group::after {
  content: attr(data-suffix);
  position: absolute;
  right: 16px;
  pointer-events: none;
  color: var(--text-color);
  white-space: nowrap; /* Prevent suffix from wrapping */
  font-size: 14px; /* Slightly smaller font size for suffix */
  background-color: white; /* Add background to ensure text doesn't show through */
  padding-left: 8px; /* Add some padding to separate from input text */
}

/* Add specific styling for each input based on its suffix length */
.input-group[data-suffix="€"] input,
.input-group[data-suffix="%"] input {
  padding-right: 40px; /* Smaller padding for short units */
}

.input-group[data-suffix="€/year"] input,
.input-group[data-suffix="€/month"] input,
.input-group[data-suffix="months"] input,
.input-group[data-suffix="years"] input {
  padding-right: 80px; /* Larger padding for longer units */
}

/* Remove up/down arrows (spinners) from number inputs */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* Style buttons with more rounded corners */
button {
  border-radius: 24px;
  padding: 12px 24px;
  transition: background-color 0.2s, transform 0.1s;
}

button:hover {
  transform: translateY(-1px);
}

/* Make only the Net Result headers more prominent */
#buyingNetWorth, #rentingNetWorth {
  font-size: 22px;
  font-weight: 700;
}

/* Style for the Net Result labels */
.result-item:last-child .result-label:has(+ #buyingNetWorth),
.result-item:last-child .result-label:has(+ #rentingNetWorth) {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

/* Style for the description section */
.description {
  margin: 0 0 24px 0;
  padding: 0 16px;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.description p {
  color: var(--text-color);
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

/* Footer styling */
.footer {
  margin-top: 40px;
  padding: 16px;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: var(--text-secondary-color);
  border-top: 1px solid var(--border-color);
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--primary-dark-color);
  text-decoration: underline;
}

/* Results Table Styling */
.results-table-container {
  margin: 30px 0;
  padding: 0 16px;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Roboto', sans-serif;
  background-color: white;
}

.results-table th,
.results-table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
}

.results-table th {
  background-color: var(--secondary-color);
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
  color: var(--text-color);
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table tr:hover {
  background-color: rgba(26, 115, 232, 0.05);
}

.results-table .positive-diff {
  color: #34a853; /* Google green */
}

.results-table .negative-diff {
  color: #ea4335; /* Google red */
}

/* Export Button Styling */
#exportBtnContainer {
  display: flex;
  align-items: center;
}

.export-btn {
  background-color: var(--success-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-family: 'Google Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.export-btn:hover {
  background-color: #0f6d2b;
  transform: translateY(-1px);
}

/* Export Modal Styling */
.export-modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}

.export-modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 24px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideIn 0.3s;
}

.export-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  transition: color 0.2s;
}

.export-close-btn:hover {
  color: #000;
}

.export-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: 'Roboto', sans-serif;
}

.export-table th {
  background-color: var(--primary-color);
  color: white;
  text-align: left;
  padding: 12px;
  font-weight: 500;
}

.export-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

.export-table tr:last-child td {
  border-bottom: none;
}

.export-section-header {
  background-color: #f5f5f5;
  font-weight: 500;
  font-family: 'Google Sans', sans-serif;
}

.export-section-header td {
  padding: 12px;
  color: var(--primary-color);
}

.export-excel-btn {
  background-color: #217346; /* Excel green color */
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-family: 'Google Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: block;
  margin: 20px auto 0;
}

.export-excel-btn:hover {
  background-color: #1a5c38;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Chart Styling */
.chart-container {
  margin: 30px 0;
  padding: 0 16px;
}

.chart-wrapper {
  margin-top: 16px;
  padding: 16px;
  background-color: white;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  height: 650px;
}

#netWorthChart {
  width: 100%;
  height: 100%;
}

/* Header Container */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.header-container h1 {
    margin: 20px 0;
    flex-grow: 1;
    text-align: center;
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 10px;
    position: absolute;
    right: 0;
    top: 0;
}

.language-option {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    width: 28px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-option img {
    display: block;
    width: 24px;
    height: 16px;
    object-fit: cover;
}

.language-option:hover {
    transform: scale(1.1);
}

.language-option.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
}
