/* ============================================================
   Mutual Fund Module — User/Investor Styles
   File: assests/css/mutual-fund.css
   ============================================================ */

/* ---------- Page Header ---------- */
.mf-page-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1a237e 100%);
    border-radius: 20px;
    padding: 35px 40px;
    color: #fff;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(26,35,126,0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.mf-page-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 250px; height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
}

/* Custom Alignment Classes */
.bg-white-glass {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.bg-danger-glass {
    background: rgba(239, 68, 68, 0.3) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-logo-3d {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-white {
    background: #ffffff;
    color: #1a237e !important;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-white:hover {
    background: #f0f4f8;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    color: #000 !important;
}

.mf-pan-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    letter-spacing: 1px;
}

/* ---------- Summary Cards ---------- */
.mf-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.mf-summary-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    border-left: 4px solid #1565c0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.mf-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.mf-summary-card .label {
    font-size: 0.78rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 6px;
}
.mf-summary-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a237e;
    line-height: 1.2;
}
.mf-summary-card .sub {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 4px;
}
.mf-card-green  { border-left-color: #10b981; }
.mf-card-red    { border-left-color: #ef4444; }
.mf-card-amber  { border-left-color: #f59e0b; }
.mf-card-green .value { color: #065f46; }
.mf-card-red .value   { color: #991b1b; }

/* ---------- Tabs ---------- */
.mf-tabs {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 24px;
    width: fit-content;
    flex-wrap: wrap;
}
.mf-tab-btn {
    padding: 9px 22px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.mf-tab-btn.active {
    background: #fff;
    color: #1a237e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mf-tab-btn:hover:not(.active) { background: rgba(255,255,255,0.6); color: #374151; }
.mf-tab-pane { display: none; }
.mf-tab-pane.active { display: block; }

/* ---------- Fund Portfolio Table ---------- */
.mf-table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-bottom: 24px;
}
.mf-table-card .mf-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f3f4f6;
}
.mf-table-card .mf-table-header h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a237e;
    margin: 0;
}
.mf-table-wrapper { overflow-x: auto; }
.mf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.mf-table thead th {
    background: #f8fafc;
    padding: 13px 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #6b7280;
    font-weight: 700;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.mf-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.mf-table tbody tr:hover { background: #fafbff; }
.mf-table tbody tr:last-child { border-bottom: none; }
.mf-table td {
    padding: 14px 16px;
    color: #374151;
    vertical-align: middle;
}
.mf-table td.fund-name { font-weight: 600; color: #1a237e; max-width: 200px; }
.mf-table td.fund-category {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

/* ---------- Gain / Loss Badges ---------- */
.mf-gain {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}
.mf-gain.positive { background: #d1fae5; color: #065f46; }
.mf-gain.negative { background: #fee2e2; color: #991b1b; }
.mf-gain.neutral  { background: #f3f4f6; color: #6b7280; }

/* ---------- SIP Status ---------- */
.sip-status-active  { color: #065f46; font-weight: 700; }
.sip-status-missing { color: #b45309; font-weight: 700; }
.sip-status-paused  { color: #6b7280; font-weight: 600; }
.mf-missing-sip-row { background: #fffbeb !important; }
.mf-missing-alert {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #92400e;
    font-weight: 600;
}

/* ---------- Folio Badge ---------- */
.folio-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #3730a3;
    background: #e0e7ff;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.source-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}
.source-cams     { background: #dbeafe; color: #1e40af; }
.source-kfintech { background: #fce7f3; color: #9d174d; }
.source-manual   { background: #f3f4f6; color: #6b7280; }

/* ---------- Empty State ---------- */
.mf-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}
.mf-empty i { font-size: 3rem; margin-bottom: 16px; display: block; color: #d1d5db; }
.mf-empty h5 { font-size: 1.1rem; color: #6b7280; margin-bottom: 8px; }
.mf-empty p  { font-size: 0.9rem; }

/* ---------- Transactions ---------- */
.txn-type-buy  { color: #065f46; font-weight: 700; }
.txn-type-sell { color: #991b1b; font-weight: 700; }
.txn-type-sip  { color: #1d4ed8; font-weight: 700; }

/* ---------- Loading Spinner ---------- */
.mf-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}
.mf-spinner {
    width: 40px; height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: mf-spin 0.8s linear infinite;
}
@keyframes mf-spin { to { transform: rotate(360deg); } }

/* ---------- PAN Prompt (not logged in / no PAN) ---------- */
.mf-pan-prompt {
    background: #fff;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    box-shadow: 0 2px 16px rgba(0,0,0,0.07);
    max-width: 480px;
    margin: 40px auto;
}
.mf-pan-prompt .icon-wrap {
    width: 72px; height: 72px;
    background: linear-gradient(135deg,#1a237e,#1565c0);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.mf-pan-prompt .icon-wrap i { font-size: 1.8rem; color: #fff; }
.mf-pan-prompt h4 { font-weight: 700; color: #1a237e; margin-bottom: 8px; }
.mf-pan-prompt p  { color: #6b7280; font-size: 0.9rem; margin-bottom: 24px; }
.mf-pan-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.mf-pan-input:focus { border-color: #1565c0; }
.mf-btn-primary {
    background: linear-gradient(135deg,#1565c0,#1a237e);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s, transform 0.2s;
}
.mf-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .mf-page-header { padding: 22px 18px; }
    .mf-page-header h1 { font-size: 1.4rem; }
    .mf-summary-cards { grid-template-columns: 1fr 1fr; }
    .mf-tabs { width: 100%; }
    .mf-tab-btn { padding: 8px 14px; font-size: 0.82rem; }
}
@media (max-width: 480px) {
    .mf-summary-cards { grid-template-columns: 1fr; }
}
