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

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

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.header-brand {
    flex: 1;
}

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

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    opacity: 0.9;
}

.tagline {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-menu a.active {
    background: rgba(255, 255, 255, 0.25);
}

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

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

.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);
}

/* Main content */
main {
    padding: 3rem 0;
    padding-top: 0;
}

section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Hero section */
.hero {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    margin-top: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.95;
}

/* Intro section */
.intro h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.intro p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Investment cards */
.investments h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.investment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.investment-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.investment-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.investment-card h4 {
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.metrics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

.metric {
    font-size: 0.95rem;
    color: #555;
}

.metric strong {
    color: #667eea;
}

.investment-card p {
    color: #666;
    line-height: 1.6;
}

/* Benefits section */
.benefits h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.benefit {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.benefit h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.benefit p {
    color: #666;
    font-size: 0.95rem;
}

/* Disclaimer */
.disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.disclaimer p {
    color: #856404;
    font-size: 0.9rem;
}

/* CTA Buttons */
.cta-buttons {
    margin-top: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Investments List Page */
.investments-list {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.investments-list h2 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.section-description {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Filters */
.filters {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.filter-select,
.filter-input {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
}

.filter-input-small {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    background: white;
    width: 80px;
}

.filter-select:focus,
.filter-input:focus,
.filter-input-small:focus {
    outline: none;
    border-color: #667eea;
}

.btn-reset {
    padding: 0.6rem 1.2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-end;
}

.btn-reset:hover {
    background: #5568d3;
}

/* Stats */
.stats {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: #666;
}

#resultCount {
    font-weight: 700;
    color: #667eea;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.investment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.investment-table thead {
    background: #667eea;
    color: white;
}

.investment-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.investment-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.investment-table th.sortable:hover {
    background: #5568d3;
}

.investment-table th.sortable::after {
    content: '\2195';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
}

.investment-table th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.investment-table th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

.investment-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

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

.investment-table td {
    padding: 0.75rem;
}

.investment-table .ticker {
    font-weight: 700;
    color: #667eea;
    font-family: monospace;
}

.investment-table .title {
    font-weight: 600;
    color: #333;
}

.investment-table .yield {
    font-weight: 600;
    color: #28a745;
}

.investment-table .frequency {
    color: #666;
    font-size: 0.9rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-reit {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-bdc {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-mlp {
    background: #fff3e0;
    color: #e65100;
}

.badge-cef {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-preferred {
    background: #fce4ec;
    color: #c2185b;
}

/* Button Details */
.btn-details {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-details:hover {
    background: #5568d3;
}

/* Page Content (Contact, etc.) */
.page-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-content h2 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.page-content .content {
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Contact Form */
.contact-form-container {
    max-width: 600px;
    margin: 2rem 0;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .hidden {
    display: none;
}

.btn-submit {
    background: #667eea;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #5568d3;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Header and Navigation */
    header {
        padding: 1rem 0;
    }

    .header-container {
        flex-wrap: wrap;
    }

    .header-brand {
        flex: 1;
        min-width: 0;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile Navigation */
    .main-nav {
        width: 100%;
        order: 3;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        background: rgba(102, 126, 234, 0.95);
        border-radius: 8px;
        margin-top: 1rem;
    }

    .nav-menu.active {
        max-height: 300px;
        padding: 1rem 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 1.5rem;
        border-radius: 0;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

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

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

    section {
        padding: 1.5rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .btn-reset {
        width: 100%;
    }

    .investments-list {
        padding: 1rem;
    }

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

    .investment-table th,
    .investment-table td {
        padding: 0.5rem 0.4rem;
    }

    .investment-table th.sortable {
        padding-right: 1.2rem;
    }

    /* Stack table on mobile for better readability */
    .table-container {
        overflow-x: scroll;
    }

    .page-content {
        padding: 1.5rem;
    }

    .contact-form-container {
        padding: 0;
    }
}
