/* Root Variables */
:root {
    --primary-color: #1e40af;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Fund Colors */
    --spus-color: #3b82f6;
    --hlal-color: #8b5cf6;
    --spte-color: #06b6d4;
    --umma-color: #10b981;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Navigation */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::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 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

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

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-summary {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    display: grid;
    gap: 1rem;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.55s both;
}

.hero-summary-title {
    font-weight: 900;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.hero-summary-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    line-height: 1.7;
    font-weight: 700;
}

.hero-summary-line strong {
    font-weight: 900;
    font-size: 1.05rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-weight: 900;
}

.hero-pill.positive {
    background: rgba(16, 185, 129, 0.18);
}

.hero-pill.negative {
    background: rgba(239, 68, 68, 0.18);
}

.hero-meta {
    opacity: 0.9;
    font-weight: 700;
}

.hero-pl {
    font-weight: 900;
}

.hero-pl.positive {
    color: rgba(209, 250, 229, 0.98);
}

.hero-pl.negative {
    color: rgba(254, 226, 226, 0.98);
}

.hero-funds-mini {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero-fund-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-weight: 800;
}

.hero-fund-chip .sym {
    font-weight: 900;
}

.hero-fund-chip .chg {
    font-weight: 900;
}

.hero-fund-chip .chg.positive {
    color: rgba(209, 250, 229, 0.95);
}

.hero-fund-chip .chg.negative {
    color: rgba(254, 226, 226, 0.95);
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 150px;
    transition: transform 0.3s, background 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Sections */
.funds-section,
.calculator-section,
.portfolio-section,
.comparison-section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.live-status {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: -2rem;
    margin-bottom: 2rem;
}

.portfolio-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
}

.summary-card {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.summary-label {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-primary);
}

.portfolio-quotes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.quote-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.quote-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.quote-symbol {
    font-size: 1.1rem;
    font-weight: 900;
}

.quote-change {
    font-weight: 800;
    font-size: 0.95rem;
}

.quote-price {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 0.25rem;
}

.quote-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.portfolio-panel {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.trade-form {
    display: grid;
    gap: 1rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.trade-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-buy {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--danger-color), #b91c1c);
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.25);
}

.btn-tertiary {
    background: white;
    color: var(--text-primary);
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-tertiary:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.15);
}

.trade-hint {
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: var(--light-bg);
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.balance-editor {
    margin-top: 0.25rem;
    display: grid;
    gap: 0.85rem;
    padding-top: 0.25rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.7);
}

.balance-editor .trade-actions {
    grid-template-columns: 1fr;
}

.portfolio-chart {
    background: var(--light-bg);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    background: white;
}

.portfolio-table th {
    background: var(--light-bg);
    padding: 1rem;
    text-align: right;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.portfolio-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.portfolio-table tbody tr:hover {
    background: var(--light-bg);
}

.portfolio-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.portfolio-cards {
    display: none;
    margin-top: 0.75rem;
    gap: 0.75rem;
}

.portfolio-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.portfolio-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
}

.portfolio-card-title .muted {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
}

.portfolio-kv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.portfolio-kv-item {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.portfolio-kv-item .k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.portfolio-kv-item .v {
    font-weight: 900;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Fund Cards */
.funds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}

.fund-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeInUp 0.6s ease;
}

.fund-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.fund-header {
    padding: 1.25rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fund-header.spus-color {
    background: linear-gradient(135deg, var(--spus-color), #2563eb);
}

.fund-header.hlal-color {
    background: linear-gradient(135deg, var(--hlal-color), #7c3aed);
}

.fund-header.spte-color {
    background: linear-gradient(135deg, var(--spte-color), #0891b2);
}

.fund-header.umma-color {
    background: linear-gradient(135deg, var(--umma-color), #059669);
}

.fund-name {
    font-size: 1.6rem;
    font-weight: 900;
}

.fund-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.75rem;
    border-radius: 25px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.halal-badge {
    background: rgba(16, 185, 129, 0.2);
}

.fund-body {
    padding: 1.25rem;
}

.fund-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.8;
    min-height: 52px;
    font-size: 0.95rem;
}

.fund-stats {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.fund-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    background: var(--light-bg);
    border-radius: 10px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.positive {
    color: var(--success-color);
}

.stat-value.negative {
    color: var(--danger-color);
}

.fund-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.feature-tag {
    background: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-tag i {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

/* Calculator Section */
.calculator-section {
    background: white;
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.calculator-input,
.calculator-results {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 20px;
}

.allocation-visual {
    margin-top: 1.25rem;
    display: grid;
    gap: 1rem;
}

.allocation-pie-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.allocation-pie-title {
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.allocation-pie-wrap {
    height: 260px;
}

.allocation-breakdown {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.allocation-breakdown-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
}

.allocation-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.allocation-row:last-child {
    border-bottom: none;
}

.allocation-row-title {
    font-weight: 900;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.allocation-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.allocation-row-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    line-height: 1.6;
}

.allocation-row-value {
    font-weight: 900;
    color: var(--text-primary);
    text-align: left;
}

.allocation-row-value small {
    display: block;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Tajawal', sans-serif;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.strategy-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.strategy-btn {
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
}

.strategy-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.strategy-btn:hover {
    border-color: var(--primary-color);
    background: var(--light-bg);
}

.strategy-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.strategy-btn.active i {
    color: white;
}

.btn-calculate {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 1.25rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Tajawal', sans-serif;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.results-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.results-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Results Display */
.allocation-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.result-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
}

.result-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.expected-return {
    font-size: 2rem;
    font-weight: 900;
}

.allocation-item {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.allocation-info h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.allocation-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.allocation-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.6s ease;
}

.allocation-amount {
    text-align: left;
}

.amount-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--success-color);
}

.amount-percentage {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Comparison Section */
.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    position: relative;
    height: 420px;
}

.comparison-table {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.comparison-cards {
    display: none;
    gap: 0.75rem;
}

.comparison-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.comparison-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comparison-card-title {
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.comparison-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.comparison-card-item {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.comparison-card-item .k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.comparison-card-item .v {
    font-weight: 900;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    background: var(--light-bg);
    padding: 1.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
}

.comparison-table td {
    padding: 1.5rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table tbody tr:hover {
    background: var(--light-bg);
}

.risk-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.risk-badge.low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.risk-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.risk-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.close {
    color: var(--text-secondary);
    float: left;
    font-size: 2rem;
    font-weight: bold;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--text-primary);
}

.modal-header {
    padding: 2rem;
    color: white;
    text-align: center;
}

.modal-body-content {
    padding: 2rem;
}

.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.holding-card {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.holding-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.holding-weight {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 900;
}

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

.info-card {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 15px;
}

.info-card h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.info-card .value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.disclaimer {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (min-width: 1024px) {
    .funds-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-summary {
        padding: 1rem;
        border-radius: 16px;
        margin-top: 1.5rem;
        max-width: 100%;
    }

    .hero-summary-line {
        justify-content: center;
        gap: 0.45rem 0.6rem;
        font-size: 0.95rem;
    }

    .hero-fund-chip {
        padding: 0.32rem 0.55rem;
        font-size: 0.92rem;
    }

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

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

    .portfolio-quotes {
        grid-template-columns: 1fr 1fr;
    }

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

    .portfolio-panel {
        padding: 1rem;
    }

    .portfolio-table {
        min-width: 0;
    }

    .table-wrap {
        display: none;
    }

    .portfolio-cards {
        display: grid;
    }

    .portfolio-kv {
        grid-template-columns: 1fr;
    }

    .calculator-container {
        grid-template-columns: 1fr;
    }

    .strategy-buttons {
        grid-template-columns: 1fr;
    }

    .comparison-section {
        padding: 56px 0;
    }

    .chart-container {
        padding: 1rem;
        border-radius: 16px;
        margin-bottom: 1.5rem;
        height: 300px;
    }

    .comparison-table {
        display: none;
    }

    .comparison-cards {
        display: grid;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-card {
        width: 100%;
    }

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

    .portfolio-quotes {
        grid-template-columns: 1fr;
    }

    .trade-actions {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 1.45rem;
    }

    .quote-price {
        font-size: 1.35rem;
    }

    .hero-summary {
        padding: 0.9rem;
    }

    .hero-summary-title {
        font-size: 0.95rem;
        margin-bottom: 0.35rem;
    }

    .hero-summary-line strong {
        font-size: 1rem;
    }


    .chart-container {
        height: 240px;
    }

    .comparison-card-grid {
        grid-template-columns: 1fr;
    }
}
