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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f8f9fa;
}

/* Header */
.header {
    background: #1a3a52;
    color: white;
    padding: 2rem 0;
    border-bottom: 4px solid #d4a574;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.tagline {
    color: #b8c5d1;
    font-size: 1rem;
}

.header-stats {
    display: flex;
    gap: 3rem;
}

.header-stat {
    text-align: right;
}

.header-stat span {
    display: block;
    font-size: 0.875rem;
    color: #b8c5d1;
    margin-bottom: 0.25rem;
}

.header-stat strong {
    font-size: 1.5rem;
    color: #d4a574;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
.section {
    background: white;
    padding: 2.5rem;
    margin: 2rem 0;
    border: 1px solid #e1e8ed;
}

.section h2 {
    color: #1a3a52;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #d4a574;
    padding-bottom: 0.5rem;
}

.section-subtitle {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.summary-item {
    padding: 1rem;
    border-left: 3px solid #d4a574;
    background: #f8f9fa;
}

.summary-item label {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item p {
    font-size: 1.125rem;
    color: #1a3a52;
    font-weight: 500;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.data-table thead {
    background: #1a3a52;
    color: white;
}

.data-table th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.data-table td {
    padding: 0.875rem;
    border-bottom: 1px solid #e1e8ed;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .total-row {
    background: #f8f9fa;
    border-top: 2px solid #1a3a52;
}

.bull-row {
    background: #f0f9f4;
}

.base-row {
    background: #f0f5fa;
}

.bear-row {
    background: #fff8f0;
}

.table-note {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Calculator */
.calculator {
    background: #f8f9fa;
    padding: 2rem;
    border: 1px solid #e1e8ed;
    margin-top: 1.5rem;
}

.calculator-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.calculator-input-row label {
    font-weight: 600;
    color: #1a3a52;
    font-size: 1.125rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #1a3a52;
    padding: 0.5rem;
}

.input-prefix {
    font-weight: 600;
    color: #1a3a52;
    font-size: 1.25rem;
    margin-right: 0.25rem;
}

#investment-amount {
    border: none;
    outline: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a3a52;
    width: 200px;
    font-family: inherit;
}

.quick-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.quick-btn {
    background: white;
    border: 2px solid #1a3a52;
    color: #1a3a52;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.quick-btn:hover,
.quick-btn.active {
    background: #1a3a52;
    color: white;
}

.results-table {
    margin-top: 2rem;
}

/* Scenario Boxes */
.scenario-box {
    border: 2px solid #e1e8ed;
    margin-bottom: 2rem;
}

.scenario-header {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.bull-box .scenario-header {
    background: #e8f5e9;
    border-bottom: 2px solid #4caf50;
}

.base-box .scenario-header {
    background: #e3f2fd;
    border-bottom: 2px solid #2196f3;
}

.bear-box .scenario-header {
    background: #fff3e0;
    border-bottom: 2px solid #ff9800;
}

.scenario-header h3 {
    color: #1a3a52;
    font-size: 1.25rem;
    font-weight: 600;
}

.irr-label {
    background: #1a3a52;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.scenario-body {
    padding: 1.5rem;
}

.scenario-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.scenario-col h4 {
    color: #1a3a52;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.scenario-col ul {
    list-style: none;
    padding: 0;
}

.scenario-col li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e1e8ed;
    color: #495057;
}

.scenario-col li:last-child {
    border-bottom: none;
}

/* Mini Table */
.mini-table {
    width: 100%;
    border-collapse: collapse;
}

.mini-table tr {
    border-bottom: 1px solid #e1e8ed;
}

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

.mini-table td {
    padding: 0.75rem 0;
}

.mini-table td:first-child {
    color: #6c757d;
}

.mini-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #1a3a52;
}

/* Structure Grid */
.structure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.structure-box {
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 3px solid #d4a574;
}

.structure-box h4 {
    color: #1a3a52;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.structure-box p {
    color: #495057;
    line-height: 1.6;
}

/* Disclosure */
.disclosure-section {
    background: #fff8f0;
    border: 2px solid #ff9800;
}

.risk-list {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.risk-list li {
    margin-bottom: 0.5rem;
    color: #495057;
}

.disclaimer {
    background: white;
    padding: 1.25rem;
    border-left: 4px solid #ff9800;
    margin-top: 1.5rem;
}

/* Footer */
.footer {
    background: #1a3a52;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    margin: 0.25rem 0;
}

.footer-content strong {
    color: #d4a574;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .header-stat {
        text-align: left;
    }

    .section {
        padding: 1.5rem;
    }

    .scenario-cols {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem;
        white-space: nowrap;
    }

    #investment-amount {
        width: 150px;
    }

    .structure-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .structure-box {
        padding: 1.5rem;
    }

    .results-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calculator-section {
        padding: 1.5rem;
    }

    .scenario-box {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .irr-label {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .calculator-input-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .market-highlights {
        flex-direction: column;
    }

    .market-stat-box {
        min-width: 100%;
    }

    .structure-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-container {
        padding: 2rem 1.5rem;
    }

    .auth-container h2 {
        font-size: 1.5rem;
    }

    .quick-buttons {
        flex-wrap: wrap;
    }

    .quick-btn {
        flex: 1 1 45%;
        min-width: 100px;
    }

    .market-section {
        padding: 1.25rem;
    }

    .market-section h3 {
        font-size: 1.1rem;
    }

    .scenario-box {
        margin: 1.5rem 0;
    }

    .mini-table {
        font-size: 0.85rem;
    }

    .mini-table td {
        padding: 0.5rem;
    }
}

/* Market Analysis Styles */
.market-highlights {
    display: flex;
    gap: 2rem;
    margin: 2rem 0 3rem 0;
    flex-wrap: wrap;
}

.market-stat-box {
    flex: 1;
    min-width: 250px;
    background: #1a3a52;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 3px solid #d4a574;
}

.market-stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.market-stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-stat-box p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

.market-details {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.market-section {
    background: white;
    padding: 1.75rem;
    border-radius: 8px;
    border-left: 4px solid #1a3a52;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.market-section h3 {
    color: #1a3a52;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.market-section ul {
    list-style: none;
    padding: 0;
}

.market-section li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.market-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #1a3a52;
    font-weight: bold;
}

.market-section p {
    line-height: 1.8;
    color: #555;
}

.citation {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #777;
    font-style: italic;
}

/* Password Protection Styles */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a3a52;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.auth-container {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 450px;
    width: 90%;
    border: 4px solid #d4a574;
}

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

.auth-logo img {
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.auth-container h2 {
    color: #1a3a52;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.auth-subtitle {
    color: #777;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.auth-form {
    margin-bottom: 1rem;
}

.auth-form input[type="password"] {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: border-color 0.3s;
}

.auth-form input[type="password"]:focus {
    outline: none;
    border-color: #d4a574;
}

.auth-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: #1a3a52;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-form button:hover {
    background: #2c5168;
}

.auth-form button:active {
    transform: translateY(0);
}

.auth-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

.auth-note {
    color: #999;
    font-size: 0.85rem;
    margin-top: 1rem;
}

.content-locked {
    display: none;
}
