/*
 * Styles for the Global Net Worth Percentile Calculator
 */

/* Define a few colour variables for easy tweaking */
:root {
    /* Apple-inspired palette: crisp blues and neutral greys */
    --primary-color: #007aff; /* signature Apple blue for buttons and highlights */
    --secondary-color: #f5f5f7; /* light neutral background used on Apple sites */
    --accent-color: #007aff; /* reuse blue for progress bars for a cohesive look */
    --text-dark: #1d1d1f; /* near black for high contrast text */
    --text-light: #ffffff; /* pure white text for buttons */
    /* Additional colours for gradients and accents */
    --gradient-start: #6f00ff;
    --gradient-end: #0099ff;
    --success-color: #34c759; /* green accent for share button */
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-dark);
    line-height: 1.6;
}

header {
    background-color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dark);
    border-bottom: 1px solid #d2d2d7;
}

header h1 {
    margin: 0;
    font-size: 2.4rem;
    font-weight: 600;
}

/* Remove the hero image styling entirely; the updated design uses clean white space */

/* Hero section with vibrant gradient and illustration */
.hero {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--text-light);
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: left;
}

.hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1200px;
    width: 100%;
}

.hero-image img {
    width: 300px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.hero-text {
    flex: 1;
    padding: 20px;
}

.hero-text h2 {
    margin-top: 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.cta-button {
    display: inline-block;
    background-color: var(--text-light);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
}

/* Card styling for the calculator section */
.card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    padding: 40px 30px;
    position: relative;
    margin-top: -80px; /* overlap the hero section */
    z-index: 1;
}

/* Share section */
.share-container {
    margin-top: 30px;
    text-align: center;
}

.share-button {
    background-color: var(--success-color);
    color: var(--text-light);
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.share-button:hover {
    background-color: #2da44e;
}

/* Charts wrapper and canvas styling */
.chart-wrapper {
    margin-top: 40px;
}

.chart-container {
    /* Give each chart its own card-like container for a premium feel */
    width: 100%;
    height: 240px;
    margin-bottom: 30px;
    background-color: #fafafa;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* Threshold tables below charts to display key percentiles and net worth values */
.threshold-table {
    margin-top: 8px;
    background-color: #f9f9f9;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #3a3a3c;
    line-height: 1.4;
}

.threshold-table .threshold-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}
.threshold-table .threshold-item:not(:last-child) {
    border-bottom: 1px solid #e5e5ea;
}
.threshold-table .percentile {
    font-weight: 500;
}
.threshold-table .value {
    font-family: monospace;
    color: #1d1d1f;
}

/* Ensure the canvas fills the container without distortion */
.chart-container canvas {
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container p {
    margin-bottom: 1rem;
}

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 2rem;
}

form label {
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="number"],
select {
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    color: var(--text-dark);
}

button {
    padding: 14px;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

button:hover {
    background-color: #005bbb;
}

.result {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Group container for the two percentile result sections */
/* Container for both result sections */
.results-container {
    margin-top: 30px;
}

/* Separate global and local result sections */
/* Provide separation between global and local result sections */
.result-section {
    margin-bottom: 30px;
}

/* Introductory paragraph styling for improved readability */
.intro p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Constrain the width of the intro section to improve readability */
.intro {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    background-color: #e5e5ea;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    height: 22px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--gradient-end));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

/* Disclaimer text appears subtle and secondary */
.disclaimer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #6e6e73;
    line-height: 1.4;
}