/* ===== MoneyControl-Style Mutual Fund Page Styles ===== */

/* Hero Section */
.mf-hero {
    position: relative;
    padding: 4rem 8% 2.5rem;
    background: linear-gradient(135deg, #061c3f 0%, #0a2a5e 50%, #0d3470 100%);
    color: #fff;
    overflow: hidden;
}

.mf-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(212,175,55,0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(46,125,50,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.mf-hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    position: relative;
    z-index: 2;
}

.mf-hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.mf-hero-right {
    display: flex;
    justify-content: flex-end;
}

/* Track Your Portfolio Card */
.hero-portfolio-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    max-width: 440px;
    width: 100%;
}

.hero-portfolio-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-4px);
}

.hero-portfolio-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.6rem;
}

.hero-portfolio-card p {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 1.6rem !important;
}

.hp-icon {
    font-size: 2rem;
    color: #d4af37;
    margin-bottom: 1rem;
}

.hp-links {
    display: grid;
    gap: 0.8rem;
}

.hp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.hp-btn:hover {
    background: #d4af37;
    color: #061c3f;
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
}

.mf-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.3);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.mf-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #d4af37, #f0d060);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mf-hero p {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 2rem;
}

/* Search Bar */
.mf-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    width: 100%;
    max-width: 480px;
    margin: 0 0 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.mf-search-bar:focus-within {
    border-color: #d4af37;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(212,175,55,0.15);
}

.mf-search-bar i {
    color: rgba(255,255,255,0.5);
    margin-right: 10px;
    font-size: 1rem;
}

.mf-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 0.6rem 0;
    outline: none;
}

.mf-search-bar input::placeholder {
    color: rgba(255,255,255,0.4);
}

.mf-search-bar kbd {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Quick Tags */
.mf-quick-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 1rem;
}

.mf-quick-tags span {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mf-quick-tags span:hover {
    background: rgba(212,175,55,0.2);
    border-color: rgba(212,175,55,0.4);
    color: #d4af37;
}

/* Stats Bar */
.mf-stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.mf-stats-bar .stat-item {
    text-align: center;
}

.mf-stats-bar .stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #d4af37;
}

.mf-stats-bar .stat-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.mf-section {
    padding: 3rem 8%;
}

.mf-section-alt {
    background: #f0f4f8;
}

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

.section-head {
    margin-bottom: 2rem;
}

.section-head h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #061c3f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-head h2 i {
    color: #d4af37;
    font-size: 1.3rem;
}

.section-head p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Category Tabs */
.cat-tabs-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.cat-tab:hover {
    border-color: #061c3f;
    color: #061c3f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cat-tab.active {
    background: linear-gradient(135deg, #061c3f, #0a2a5e);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(6,28,63,0.3);
}

.cat-tab i {
    font-size: 0.9rem;
}

/* AMC Grid */
.amc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.amc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
}

.amc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--amc-color, #061c3f);
}

.amc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Main Grid Layout */
.mf-main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

/* Fund Table Card */
.fund-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.ftc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #f1f3f5;
    flex-wrap: wrap;
    gap: 10px;
}

.ftc-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #061c3f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ftc-header h2 i {
    color: #d4af37;
}

.ftc-info {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ftc-body {
    max-height: 600px;
    overflow-y: auto;
}

.ftc-body::-webkit-scrollbar {
    width: 6px;
}

.ftc-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Fund Table */
#fundTable {
    width: 100%;
    border-collapse: collapse;
}

#fundTable thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    z-index: 5;
}

#fundTable tbody tr {
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

#fundTable tbody tr:hover {
    background: #f0f7ff;
}

.fn-name {
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fn-icon {
    color: #3b82f6;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.fn-nav {
    padding: 0.9rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #061c3f;
    font-family: 'Inter', monospace;
    white-space: nowrap;
}

.fn-date {
    padding: 0.9rem 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
}

.fn-action {
    padding: 0.9rem 1rem;
    color: #cbd5e1;
    text-align: center;
}

.fn-action i {
    transition: all 0.3s ease;
}

#fundTable tbody tr:hover .fn-action i {
    color: #3b82f6;
    transform: translateX(3px);
}

.nav-load {
    color: #94a3b8;
}

/* Loading & Error States */
.mf-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.mf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.mf-error {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
}

.retry-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    font-family: inherit;
}

.mf-empty {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 1rem;
}

/* Sidebar */
.mf-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    position: sticky;
    top: 100px;
}

/* SIP Calculator Card */
.sip-calc-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.sip-calc-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #061c3f;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sip-calc-card h3 i {
    color: #d4af37;
}

.sip-field {
    margin-bottom: 1rem;
}

.sip-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sip-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-family: inherit;
}

.sip-field input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.sip-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #061c3f, #0a2a5e);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(6,28,63,0.3);
}

.sip-result {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f3f5;
}

.sip-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #475569;
}

.sip-row.total {
    border-top: 2px solid #e2e8f0;
    margin-top: 5px;
    padding-top: 12px;
    font-size: 1rem;
}

.sip-row .up {
    color: #16a34a;
}

/* Sidebar Cards */
.sidebar-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #e9ecef;
}

.tracker-card {
    text-align: center;
    background: linear-gradient(135deg, #f0f7ff, #e8f0fe);
    border-color: #bfdbfe;
}

.tracker-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #fff;
    font-size: 1.2rem;
}

.tracker-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.tracker-card p {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.tracker-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tracker-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tracker-links a:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59,130,246,0.12);
}

/* Info Card */
.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #061c3f;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card h3 i {
    color: #f59e0b;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

.info-card ul li i {
    color: #16a34a;
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 0.8rem;
}

/* ===== FUND DETAIL MODAL ===== */
.mf-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.mf-modal-content {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.md-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #061c3f, #0a2a5e);
    color: #fff;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.md-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.md-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.md-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    padding-right: 2rem;
    line-height: 1.4;
}

.md-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.md-meta span {
    background: rgba(255,255,255,0.1);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Modal Stats */
.md-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e2e8f0;
}

.md-stat {
    padding: 1.2rem;
    background: #f8fafc;
    text-align: center;
}

.md-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.md-stat-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: #061c3f;
}

.md-stat-val.small {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modal Sections */
.md-section {
    padding: 1.5rem 2rem;
    border-top: 1px solid #f1f5f9;
}

.md-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.md-section h4 i {
    color: #3b82f6;
}

/* Returns Grid */
.returns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.ret-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.ret-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ret-value {
    font-size: 1rem;
    font-weight: 800;
}

.ret-value.up, .up { color: #16a34a; }
.ret-value.down, .down { color: #ef4444; }

/* History Table */
.md-history-wrap {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.hist-table th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
}

.hist-table td {
    padding: 8px 14px;
    border-top: 1px solid #f1f5f9;
    color: #475569;
}

/* Modal Actions */
.md-actions {
    padding: 1.2rem 2rem;
    display: flex;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
}

.md-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.md-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.md-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.md-btn.secondary {
    background: #f1f5f9;
    color: #64748b;
}

.md-btn.secondary:hover {
    background: #e2e8f0;
}

.md-loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.md-err {
    color: #ef4444;
    text-align: center;
    padding: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .mf-hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    .mf-hero-left {
        align-items: center;
        text-align: center;
    }
    .mf-search-bar {
        margin: 0 auto 1.5rem;
    }
    .mf-quick-tags {
        justify-content: center;
    }
    .mf-hero-right {
        justify-content: center;
    }
    .hero-portfolio-card {
        margin: 0 auto;
    }
    .mf-main-grid {
        grid-template-columns: 1fr;
    }
    .mf-sidebar {
        position: static;
    }
    .mf-hero h1 {
        font-size: 2rem;
    }
    .mf-stats-bar {
        gap: 1.5rem;
    }
    .amc-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .md-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .mf-section {
        padding: 2rem 5%;
    }
    .mf-hero {
        padding: 3rem 5% 2rem;
    }
    .mf-hero h1 {
        font-size: 1.6rem;
    }
    .mf-search-bar {
        border-radius: 12px;
    }
    .cat-tabs-wrap {
        gap: 6px;
    }
    .cat-tab {
        padding: 8px 14px;
        font-size: 0.78rem;
    }
    .fn-name {
        max-width: 200px;
        font-size: 0.78rem;
    }
    .returns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .md-section {
        padding: 1rem 1.2rem;
    }
    .md-header {
        padding: 1.2rem;
    }
    .md-actions {
        padding: 1rem 1.2rem;
        flex-direction: column;
    }
}


