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

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    scroll-behavior: smooth;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid rgba(44, 62, 80, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.nav-logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: baseline; /* align link baselines with adjacent controls */
}

.nav-links li {
    display: flex;
    align-items: baseline; /* ensure each item aligns to text baseline */
}

.nav-links a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #3498db;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Sections */
.section {
    min-height: 100vh;
    padding: 100px 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Title Section */
.title-section {
    background-color: #f8f9fa;
    position: relative;
}

/* CTA row within title section */
.cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    text-align: center;
    margin-top: 36px;   /* more space below main title */
    margin-bottom: 36px; /* more space above accent line */
}

.cta-row .subtitle {
    margin: 0; /* override default bottom margin */
}

/* Vol Arb page specific spacing/alignment tweaks */
.vol-arb-page #overview .section-title {
    margin-bottom: 16px; /* tighter spacing above CTA */
}
.vol-arb-page #overview .cta-row {
    justify-content: flex-start; /* left align CTA */
    text-align: left;
    margin-top: 8px;   /* tighter spacing below title */
    margin-bottom: 16px; /* tighter spacing above overview grid */
}

.title-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
}

.logo {
    width: 120px;
    height: 120px;
    border: 3px solid #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ecf0f1;
}

.logo-text {
    font-size: 48px;
    font-weight: bold;
    color: #2c3e50;
    letter-spacing: 2px;
    font-family: 'Times New Roman', Times, serif;
}

.main-title {
    font-size: 64px;
    font-weight: 300;
    color: #2c3e50;
    line-height: 1.1;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 32px;
    color: #95a5a6;
    font-style: italic;
    margin-bottom: 50px;
    font-weight: 300;
}

.description {
    font-size: 28px;
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 60px;
    max-width: 900px;
}

.accent-line {
    width: 300px;
    height: 8px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    margin-bottom: 40px;
}

.title-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.contact-info {
    text-align: right;
    color: #7f8c8d;
}

.contact-name {
    font-size: 20px;
    margin-bottom: 5px;
}

.contact-title {
    font-size: 18px;
    margin-bottom: 5px;
}

.contact-phone {
    font-size: 18px;
    margin-bottom: 10px;
}

.contact-email {
    font-size: 18px;
    color: #3498db;
    text-decoration: none;
    margin-bottom: 15px;
    display: block;
}

.contact-email:hover {
    text-decoration: underline;
}

.company-name {
    font-size: 36px;
    color: #2c3e50;
    font-weight: 400;
    font-style: italic;
}

/* Overview Section */
.overview-section {
    background-color: white;
}

.section-title {
    font-size: 48px;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 40px;
    border-bottom: 4px solid #3498db;
    padding-bottom: 20px;
}

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

.overview-card {
    background: #2c3e50;
    color: white;
    padding: 30px 25px;
    border-radius: 8px;
}

.overview-card h3 {
    font-size: 24px;
    margin-bottom: 20px;
    background: #34495e;
    padding: 10px 15px;
    margin: -30px -25px 20px -25px;
    text-align: center;
    font-weight: 500;
}

.overview-card ul {
    list-style: none;
    font-size: 16px;
    line-height: 1.6;
}

.overview-card li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

.overview-card li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.sub-list {
    margin-left: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #bdc3c7;
}

.sub-list li {
    margin-bottom: 5px;
}

.highlight-text {
    color: #3498db;
    font-weight: 600;
}

.large-text {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
}

/* Comparison Section */
.comparison-section {
    background-color: #f8f9fa;
}

.comparison-intro {
    background: #e8f4fd;
    border: 2px solid #3498db;
    padding: 20px;
    margin-bottom: 40px;
    text-align: center;
    font-style: italic;
    font-size: 18px;
    color: #2c3e50;
    border-radius: 8px;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

.comparison-table {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.comparison-table th {
    background: #34495e;
    color: black;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.comparison-table th.bonds-col {
    color: white;
}

.comparison-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

.comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

.feature-column {
    background: #ecf0f1 !important;
    font-weight: 600;
    text-align: left !important;
}

.gradatim-column {
    background: #e8f8f5 !important;
    border: 2px dashed #3498db;
    font-weight: 600;
    color: black;
}

.status-good {
    color: #27ae60;
    font-weight: bold;
}

.status-bad {
    color: #e74c3c;
    font-weight: bold;
}

.status-neutral {
    color: #f39c12;
    font-weight: bold;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.green { background: #27ae60; }
.red { background: #e74c3c; }
.yellow { background: #f39c12; }

/* Chart Section */
.chart-section {
    background-color: white;
}

.chart-section .section-title {
    text-align: center;
}

.chart-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 80px 40px;
    color: white;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.chart-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50"><path d="M0,40 Q25,10 50,25 T100,15" stroke="rgba(255,255,255,0.3)" stroke-width="2" fill="none"/><path d="M0,45 Q25,35 50,30 T100,25" stroke="rgba(255,255,255,0.2)" stroke-width="1.5" fill="none"/></svg>') center/cover;
}

.chart-content {
    position: relative;
    z-index: 1;
}

.chart-title {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 20px;
}

.chart-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.chart-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.chart-feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.chart-feature h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.chart-feature p {
    font-size: 14px;
    opacity: 0.8;
}

/* Period buttons and chart */
.period-btn {
    padding: 8px 16px;
    margin: 0 5px;
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.period-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.period-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

/* Chart specific styles */
#timePeriodSelector {
    text-align: center;
}

#chartContainer {
    width: 100%;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar {
        display: none;
    }
    
    .section {
        min-height: auto;
        page-break-after: always;
        padding: 60px 40px;
    }
    
    .section:last-child {
        page-break-after: auto;
    }
    
    .chart-placeholder {
        background: #f8f9fa;
        color: #2c3e50;
        border: 2px solid #3498db;
    }
}

/* Responsive */
/* Fix for comparison table */
.comparison-table {
    width: 75%;
    margin-left: auto;
    margin-right: auto;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(248, 249, 250, 0.98);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border-top: 1px solid rgba(44, 62, 80, 0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        margin: 10px 0;
    }
    
    .nav-links a {
        display: block;
        padding: 10px 0;
        font-size: 16px;
    }
    
    .comparison-table {
        width: 90%;
    }
    
    .section {
        padding: 80px 20px 40px;
    }
    
    .title-header {
        flex-direction: column;
        gap: 30px;
    }
    
    .main-title {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 24px;
    }

    .section-title {
        font-size: 24px;
    }

    .title-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .contact-info {
        text-align: center;
    }
    
    .description {
        font-size: 20px;
    }

    /* Removed .overview-grid single-column here; see <=600px rule */

    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 4px;
    }
}

/* Stack Overview grid on small devices */
@media (max-width: 640px) { 
    .overview-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* iPhone and small mobile devices specific styles */
@media (max-width: 400px) {
    /* Navigation adjustments */
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo {
        font-size: 18px;
    }
    
    /* Section padding adjustments */
    .section {
        padding: 60px 15px 30px;
        min-height: auto;
    }
    
    /* Title section adjustments */
    .title-header {
        align-items: center;
        text-align: center;
    }

    .title-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        padding: 20px 0;
    }

    .company-name {
        font-size: 24px;
        margin-bottom: 10px
    }

    .contact-info {
    text-align: center
    }

    .contact-name {
    font-size: 18px;
    }

    .contact-title {
    font-size: 16px;
    }

    .contact-phone {
    font-size: 16px;
    }

    .contact-email {
    font-size: 16px;
    }
  
    .logo {
        width: 80px;
        height: 80px;
    }
    
    .logo-text {
        font-size: 32px;
    }
    
    .main-title {
        font-size: 28px;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .description {
        font-size: 14px;
    }
    
    /* Overview cards */
    .overview-grid {
        font-size: 12px;
        display: grid;              /* ensure grid context on mobile */
        grid-template-columns: 1fr; /* stack Overview above Why It Works */
        text-align: left;
        gap: 30px;
    }

    .overview-card {
        padding: 15px;
    }
    
    .overview-card h3 {
        font-size: 18px;
    }
    
    .overview-card ul {
        font-size: 13px;
    }
    
    /* Comparison table - Convert to stacked layout */
    .comparison-table {
        width: 100%;
        box-shadow: none;
    }
    
    .comparison-table thead {
        display: none;
    }
    
    .comparison-table tbody {
        display: block;
    }
    
    .comparison-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .comparison-table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
    }
    
    .comparison-table td.feature-column {
        font-weight: bold;
        font-size: 16px;
        margin-bottom: 10px;
        color: #2c3e50;
        border-bottom: 2px solid #3498db;
        padding-bottom: 5px;
    }
    
    .comparison-table td.gradatim-column:before {
        content: "Gradatim: ";
        font-weight: bold;
        color: #3498db;
    }
    
    .comparison-table td:last-child:before {
        content: "Bonds: ";
        font-weight: bold;
        color: #7f8c8d;
    }
    
    /* Chart container */
    #chartContainer {
        height: 300px !important;
    }
    
    /* Performance metrics grid */
    #performanceMetrics > div {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    /* Time period buttons */
    .period-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* User Menu Dropdown */
.user-menu { position: relative; display: flex; align-items: center; }
.user-avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #d0d7de; background: #fff; color: #2c3e50; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.user-avatar-btn:hover { background: #f6f8fa; }
.user-avatar-btn svg { display: block; transform: translateY(2px); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid #e6e8eb; border-radius: 8px; min-width: 180px; box-shadow: 0 10px 24px rgba(0,0,0,0.12); padding: 8px 0; display: none; z-index: 1500; }
.user-dropdown.open { display: block; }
.user-dropdown-item { display: block; padding: 10px 14px; color: #2c3e50; text-decoration: none; font-size: 14px; }
.user-dropdown-item:hover { background: #f5f7fa; color: #2980b9; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Settings Page */
.settings-container { max-width: 1000px; margin: 0 auto; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings-card { background: #fff; border: 1px solid #e6e8eb; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.card-title { font-size: 18px; font-weight: 600; padding: 14px 16px; border-bottom: 1px solid #eef0f2; color: #2c3e50; }
.card-body { padding: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 14px; color: #6b7280; }
.form-row input { padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; color: #111827; }
.form-row input[readonly] { background: #f3f4f6; color: #4b5563; }
.password-input { position: relative; }
.password-input input { width: 100%; padding-right: 40px; }
.toggle-password { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; color: #6b7280; cursor: pointer; padding: 4px; border-radius: 4px; }
.toggle-password:hover { color: #374151; background: #f3f4f6; }
.help-text { font-size: 12px; color: #77808b; margin-top: 8px; }
.form-actions { margin-top: 6px; }
.primary-btn { background: #3498db; color: #fff; border: none; padding: 10px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.primary-btn:hover { background: #2980b9; }
.form-message { margin-top: 10px; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.form-message.success { background: #e6f4ea; color: #1e6b34; border: 1px solid #b7e0c2; }
.form-message.error { background: #fde8e8; color: #8a1c1c; border: 1px solid #f3c2c2; }
.info-banner { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; padding: 10px 12px; border-radius: 6px; margin-bottom: 10px; }

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