/* FII/DII Tracker Page Styles */

/* Hero Section */
.tracker-hero {
    background: url("../img/bg/banner-bg.webp") bottom center no-repeat;
    background-size: cover;
    margin: 110px 5% 0;
    padding: 80px 0 60px;
    position: relative;
    z-index: 1;
    border-radius: 20px;
}

/* Decorative Shapes spread across the page */
.tracker-section .triangle,
.info-section .ractangle,
#monthly-table-card .half-circle-right {
    position: absolute;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

.tracker-section .triangle {
    left: 3%;
    top: 5%;
    max-width: 100px;
    animation: floating 8s ease-in-out infinite;
}

.info-section .ractangle {
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    max-width: 120px;
    animation: floating 10s ease-in-out infinite reverse;
}

#monthly-table-card .half-circle-right {
    right: 0;
    bottom: 0;
    max-width: 120px;
    opacity: 0.15;
}

#monthly-table-card {
    position: relative;
    overflow: hidden;
}

#monthly-table-card>* {
    position: relative;
    z-index: 1;
}

.tracker-section .container,
.info-section .container,
.cta-section-tracker .container {
    position: relative;
    z-index: 1;
}

@keyframes floating {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.tracker-hero .hero-header {
    text-align: center;
    margin-bottom: 50px;
}

.tracker-hero .hero-header h1 {
    font-size: 56px;
    color: #fff;
    margin-bottom: 12px;
}

.tracker-hero .hero-header .subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

.tracker-hero .data-freshness {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.tracker-hero .data-freshness i {
    font-size: 16px;
    color: #00b894;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.summary-card {
    background: rgba(47, 49, 66, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-icon i {
    font-size: 28px;
    color: #fff;
}

.fii-card .summary-icon {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.dii-card .summary-icon {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.month-card .summary-icon {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    font-family: "Poppins", sans-serif;
    font-variant-numeric: tabular-nums;
}

.fii-card .summary-value {
    color: #ff7675;
}

.dii-card .summary-value {
    color: #00b894;
}

.summary-sublabel {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

/* Dynamic positive/negative colors for summary values */
.summary-value.positive {
    color: #00b894 !important;
}

.summary-value.negative {
    color: #ff7675 !important;
}

.month-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-fii {
    font-size: 16px;
    font-weight: 600;
    color: #ff7675;
    font-family: "Poppins", sans-serif;
    font-variant-numeric: tabular-nums;
}

.month-dii {
    font-size: 16px;
    font-weight: 600;
    color: #00b894;
    font-family: "Poppins", sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Tracker Section */
.tracker-section {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.view-buttons {
    display: flex;
    gap: 4px;
    background: rgba(47, 49, 66, 0.8);
    padding: 4px;
    border-radius: 10px;
}

.view-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.view-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.month-navigator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(47, 49, 66, 0.8);
    padding: 4px 12px;
    border-radius: 10px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    color: #fff;
    background: rgba(108, 92, 231, 0.3);
    border-color: rgba(108, 92, 231, 0.5);
    transform: scale(1.05);
}

.nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
}

.current-period {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    min-width: 140px;
    text-align: center;
}

/* Chart Cards - Inherit from mutual_fund_insights.css */
.chart-card {
    background: #2F3142;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(108, 92, 231, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.chart-header {
    margin-bottom: 24px;
}

.chart-header h2 {
    font-size: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-header h2 i {
    color: #6c5ce7;
    font-size: 28px;
}

.chart-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.chart-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-title-row h2 {
    margin-bottom: 0;
}

/* Chart Header Row (for daily & asset charts) */
.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-title-group h2 {
    font-size: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-title-group h2 i {
    color: #6c5ce7;
    font-size: 28px;
}

/* Tooltips */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    cursor: help;
}

.info-icon-small {
    font-size: 20px !important;
    /* override the 28px h2 i rule */
    color: rgba(255, 255, 255, 0.4) !important;
    transition: color 0.2s ease;
}

.info-tooltip:hover .info-icon-small {
    color: rgba(255, 255, 255, 0.8) !important;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: rgba(24, 27, 46, 0.95);
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(24, 27, 46, 0.95) transparent transparent transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chart-title-group .chart-subtitle {
    margin: 0;
}

/* Embedded Controls */
.embedded-controls {
    background: rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.chart-container {
    height: 350px;
    position: relative;
}

.chart-container-tall {
    height: 400px;
}

/* Shimmer Loading Skeleton */
.skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 49, 66, 0.5);
    border-radius: 12px;
    overflow: hidden;
    z-index: 10;
    display: none;
}

.skeleton-loader.active {
    display: block;
}

.skeleton-loader::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    100% {
        left: 200%;
    }
}

/* No Data Overlay */
.no-data-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 49, 66, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    display: none;
    /* hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 20px;
}

.no-data-overlay.active {
    display: flex;
}

.no-data-overlay i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ff7675;
}

.no-data-overlay p {
    font-size: 16px;
    margin: 0;
}

/* Period Selector */
.chart-period-selector {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.chart-period-selector .period-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-period-selector .period-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.chart-period-selector .period-btn.active {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: #fff;
}

/* Chart Legend */
.chart-legend-custom {
    display: flex;
    gap: 24px;
    margin-top: 20px;
    justify-content: center;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Data Table */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.1);
}

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

.data-table th {
    text-align: left;
    padding: 16px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.data-table th:first-child {
    border-radius: 12px 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 12px 0 0;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 500;
}

.data-table td:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.data-table tbody tr {
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(108, 92, 231, 0.1);
}

.data-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.data-table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

.data-table .positive {
    color: #00b894;
    font-weight: 600;
}

.data-table .negative {
    color: #ff7675;
    font-weight: 600;
}

/* Info Section */
.info-section {
    padding: 60px 0;
    background: rgba(47, 49, 66, 0.3);
    position: relative;
    overflow: hidden;
}

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

.info-card {
    background: rgba(47, 49, 66, 0.6);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(108, 92, 231, 0.3);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.info-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.info-icon i {
    font-size: 32px;
    color: #fff;
}

.info-card h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 12px;
}

.info-card p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

/* Data Source Section */
.data-source-section {
    padding: 40px 0;
}

.source-card {
    background: rgba(47, 49, 66, 0.6);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.source-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.source-icon i {
    font-size: 28px;
    color: #fff;
}

.source-content h3 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
}

.source-content p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

.source-content a {
    color: #6c5ce7;
}

/* CTA Section */
.cta-section-tracker {
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}

.cta-section-tracker .cta-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2) 0%, rgba(162, 155, 254, 0.2) 100%);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 24px;
    padding: 60px 40px;
}

.cta-section-tracker .cta-content h2 {
    font-size: 36px;
    color: #fff;
    margin-bottom: 12px;
}

.cta-section-tracker .cta-content p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn i {
    font-size: 20px;
}

.cta-btn.primary {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    color: #fff;
}

.cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-grid .month-card {
        grid-column: span 2;
    }

    .chart-header-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 992px) {
    .tracker-hero {
        margin: 100px 3% 0;
        padding: 60px 0 40px;
    }

    .tracker-hero .hero-header h1 {
        font-size: 42px;
    }

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

    .chart-container {
        height: 280px;
    }

    .chart-container-tall {
        height: 320px;
    }

    .chart-title-group h2 {
        font-size: 20px;
    }

    .chart-title-group h2 i {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .tracker-hero {
        margin: 90px 2% 0;
        padding: 40px 0 30px;
    }

    .tracker-hero .hero-header h1 {
        font-size: 32px;
    }

    .tracker-hero .hero-header .subtitle {
        font-size: 16px;
    }

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

    .summary-grid .month-card {
        grid-column: span 1;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-value {
        font-size: 22px;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .embedded-controls {
        padding: 10px 12px;
    }

    .view-selector {
        justify-content: center;
        flex-wrap: wrap;
    }

    .view-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .month-navigator {
        justify-content: center;
    }

    .current-period {
        font-size: 14px;
        min-width: 120px;
    }

    .chart-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .chart-header h2,
    .chart-title-group h2 {
        font-size: 18px;
    }

    .chart-title-group h2 i {
        font-size: 22px;
    }

    .chart-legend-custom {
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .legend-item {
        font-size: 12px;
    }

    .source-card {
        flex-direction: column;
        text-align: center;
    }

    .cta-section-tracker .cta-content {
        padding: 40px 20px;
    }

    .cta-section-tracker .cta-content h2 {
        font-size: 28px;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .chart-period-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .chart-period-selector .period-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .chart-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .tracker-hero .hero-header h1 {
        font-size: 28px;
    }

    .summary-icon {
        width: 48px;
        height: 48px;
    }

    .summary-icon i {
        font-size: 24px;
    }

    .summary-value {
        font-size: 20px;
    }

    .chart-container {
        height: 250px;
    }

    .chart-container-tall {
        height: 280px;
    }

    .view-buttons {
        width: 100%;
        justify-content: center;
    }

    .view-btn {
        flex: 1;
        padding: 8px 10px;
        text-align: center;
    }

    .control-label {
        display: none;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
    }

    .chart-card {
        padding: 16px;
        border-radius: 16px;
    }

    .chart-title-group h2 {
        font-size: 16px;
    }

    .chart-subtitle {
        font-size: 12px;
    }
}