@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;700&display=swap');

* {
    box-sizing: border-box; /* Ensure padding and borders are included in element's total width and height */
}

body {
    font-family: 'Raleway', sans-serif;
    background-color: #f0ece3;
    margin: 0;
    padding: 20px;
}

#loginSection {
    position: fixed; /* Position it relative to the viewport */
    top: 50%;        /* Position from the top */
    left: 50%;       /* Position from the left */
    transform: translate(-50%, -50%); /* Adjust to center */
    max-width: 300px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 1000; /* Ensure it appears above other content */
}

#loginSection h2 {
    color: #00509e;
    margin-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
    color: #00509e;
    text-align: center;
    margin-bottom: 30px;
}

.controls {
    margin-bottom: 20px;
}

.add-form {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.radio-group {
    margin: 15px 0;
    display: flex;
    flex-direction: row; /* Arrange radio buttons horizontally */
    align-items: center; /* Vertically center the radio buttons */
    gap: 20px; /* Space between radio button groups */
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap; /* Prevent text from wrapping */
}

.radio-group label span {
    margin-right: 8px; /* Space between text and radio button */
}

button {
    background: #00509e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-weight: 700;
    transition: background 0.3s ease;
}

button:hover {
    background: #003d75;
}

.email-button {
    background: #28a745;
}

.email-button:hover {
    background: #1e7e34;
}

input {
    padding: 8px;
    margin: 5px 0; /* Vertical margin only */
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%; /* Full width within container */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    color: #00509e;
}

.error-log {
    margin-top: 20px;
    padding: 10px;
    background: #fff8f8;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    display: none;
}

/* Align Buttons Horizontally and Position Them Close Together */
.button-group {
    display: flex;
    justify-content: flex-start; /* Align buttons to the start (left) */
    gap: 10px; /* Space between buttons */
    margin-top: 20px;
}

/* Adjust the Add Position Form Layout */
#addForm {
    max-width: 500px;
    margin: 0 auto;
}

#addForm h3 {
    margin-bottom: 15px;
    color: #00509e;
    text-align: left;
}

#addForm input[type="text"],
#addForm input[type="number"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0 15px 0; /* More space below inputs */
    border: 1px solid #ddd;
    border-radius: 4px;
}

#addForm button {
    width: auto; /* Allow buttons to adjust their width based on content */
}
.performance-item.fee {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.performance-item.net-value {
  font-weight: bold;
  margin-top: 0.5rem;
}

.performance-item.fee .value,
.performance-item.net-value .value {
  color: #2c3e50;
}
/* Portfolio Values Styling */
.portfolio-values {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.portfolio-value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.value-label {
    color: #4a5568;
    font-size: 1rem;
}

.value-amount {
    font-family: monospace;
    text-align: right;
    font-size: 1.1rem;
    min-width: 180px;
    padding-left: 20px;
}

.gross-value .value-amount {
    color: #2c5282;
    font-weight: 600;
}

.fee-value .value-amount {
    color: #c53030;
}

.net-value .value-amount {
    color: #2f855a;
    font-weight: 700;
}

/* Button Container Styling */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-buttons button {
    flex: 1;
    min-width: 120px;
    white-space: nowrap;
    padding: 10px 15px;
    font-size: 0.95rem;
}

/* Performance Metrics Styling */
.performance-metrics {
    margin: 20px 0;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.performance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 4px 0;
}

.performance-label {
    color: #4a5568;
}

.performance-value {
    font-weight: 600;
    text-align: right;
    min-width: 120px;
}

.performance-value.positive {
    color: #38a169;
}

.performance-value.negative {
    color: #e53e3e;
}

/* Table Number Alignment */
td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5),
td:nth-child(6) {
    text-align: right;
}

th:nth-child(2),
th:nth-child(3),
th:nth-child(4),
th:nth-child(5),
th:nth-child(6) {
    text-align: right;
}

/* Loading State */
.loading {
    text-align: center;
    color: #718096;
    padding: 20px;
}

/* Error State */
.performance-error {
    color: #c53030;
    background: #fff5f5;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}
.action-buttons {
    display: flex;
    justify-content: space-between; /* Distributes any extra space between buttons */
    align-items: center;
    width: 100%;
    gap: 12px;       /* Space between buttons */
    padding: 15px 0;
    margin: 20px 0;
}

.action-buttons button {
    flex: 1;         /* Each button grows equally */
    min-width: 120px;
    white-space: nowrap;
    padding: 10px 15px;
    font-size: 0.95rem;
}
