/*
 * Flipkart Fee & Commission Analyzer Custom Stylesheet
 * Prefix: .ffca-
 */

:root {
    --ffca-primary: #1e3a8a; /* Deep Navy Flipkart-like blue */
    --ffca-primary-hover: #172554;
    --ffca-primary-light: #eff6ff;
    --ffca-success: #059669;
    --ffca-success-light: #ecfdf5;
    --ffca-danger: #dc2626;
    --ffca-danger-light: #fef2f2;
    --ffca-warning: #d97706;
    --ffca-warning-light: #fffbeb;
    --ffca-info: #0891b2;
    --ffca-info-light: #ecfeff;
    --ffca-dark: #0f172a;
    --ffca-slate: #475569;
    --ffca-light: #f8fafc;
    --ffca-border: #cbd5e1;
    --ffca-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --ffca-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --ffca-radius: 10px;
    --ffca-font: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

.ffca-wrapper {
    font-family: var(--ffca-font);
    color: var(--ffca-dark);
    margin-bottom: 4rem;
}

/* Upload Dropzone Container */
.ffca-dropzone {
    border: 2px dashed var(--ffca-border);
    border-radius: var(--ffca-radius);
    background-color: #ffffff;
    padding: 3.5rem 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: var(--ffca-shadow);
}
.ffca-dropzone:hover, .ffca-dropzone.dragover {
    border-color: var(--ffca-primary);
    background-color: var(--ffca-primary-light);
    transform: translateY(-2px);
}
.ffca-dropzone-icon {
    font-size: 3.5rem;
    color: var(--ffca-primary);
    margin-bottom: 1rem;
}

/* Loader Styles */
.ffca-loading {
    padding: 3rem;
    text-align: center;
    border-radius: var(--ffca-radius);
    background: #ffffff;
    box-shadow: var(--ffca-shadow);
    border: 1px solid var(--ffca-border);
}
.ffca-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--ffca-border);
    border-top: 4px solid var(--ffca-primary);
    border-radius: 50%;
    animation: ffca-spin 1s linear infinite;
    margin: 0 auto 1.5rem auto;
}
@keyframes ffca-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dashboard Tab Bar */
.ffca-nav-tabs {
    border-bottom: 2px solid var(--ffca-border);
    margin-bottom: 2rem;
    gap: 0.25rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.ffca-nav-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}
.ffca-nav-link {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ffca-slate);
    transition: all 0.2s ease;
    cursor: pointer;
}
.ffca-nav-link:hover {
    color: var(--ffca-primary);
}
.ffca-nav-link.active {
    color: var(--ffca-primary);
    border-bottom-color: var(--ffca-primary);
}

/* Tab Panes */
.tab-pane-custom {
    display: none;
}
.tab-pane-custom.active {
    display: block;
    animation: ffca-fade-in 0.3s ease;
}
@keyframes ffca-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard KPI Card Grid */
.ffca-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.ffca-kpi-card {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    padding: 1.25rem;
    box-shadow: var(--ffca-shadow);
    transition: all 0.2s ease;
}
.ffca-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ffca-shadow-lg);
}
.ffca-kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ffca-slate);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}
.ffca-kpi-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ffca-dark);
    line-height: 1;
}
.ffca-kpi-val.small {
    font-size: 1.1rem;
    line-height: 1.2;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Health Section layout */
.ffca-health-section {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 991px) {
    .ffca-health-section {
        grid-template-columns: 1fr;
    }
}
.ffca-gauge-container {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--ffca-shadow);
}
.ffca-insights-container {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    padding: 1.5rem;
    box-shadow: var(--ffca-shadow);
}

/* Health circular progress gauge */
.ffca-gauge-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem auto;
}
.ffca-gauge-svg {
    transform: rotate(-90deg);
}
.ffca-gauge-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 12;
}
.ffca-gauge-fill {
    fill: none;
    stroke: var(--ffca-primary);
    stroke-dasharray: 439.8;
    stroke-dashoffset: 439.8;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}
.ffca-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.ffca-gauge-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ffca-dark);
}
.ffca-gauge-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Grid layout for analytics tabs */
.ffca-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (max-width: 768px) {
    .ffca-chart-grid {
        grid-template-columns: 1fr;
    }
}
.ffca-chart-card {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    padding: 1.5rem;
    box-shadow: var(--ffca-shadow);
}
.ffca-chart-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Virtualized Scrollable database table container */
.ffca-table-container {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    overflow: hidden;
    box-shadow: var(--ffca-shadow);
}
.ffca-table-scroll {
    overflow-x: auto;
    max-height: 550px;
}
.ffca-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}
.ffca-table th {
    background-color: var(--ffca-light);
    color: var(--ffca-slate);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--ffca-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ffca-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ffca-border);
    font-size: 0.9rem;
}
.ffca-table tr:hover td {
    background-color: #f1f5f9;
}

/* Pagination */
.ffca-pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--ffca-light);
    border-top: 1px solid var(--ffca-border);
}

/* FAQ Accordion Details */
.ffca-faq-section {
    background: #ffffff;
    border: 1px solid var(--ffca-border);
    border-radius: var(--ffca-radius);
    padding: 2rem;
    margin-top: 3rem;
    box-shadow: var(--ffca-shadow);
}
.ffca-faq-details {
    border-bottom: 1px solid var(--ffca-border);
    padding: 1rem 0;
}
.ffca-faq-details:last-child {
    border-bottom: none;
}
.ffca-faq-summary {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ffca-dark);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ffca-faq-summary::-webkit-details-marker {
    display: none;
}
.ffca-faq-summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--ffca-primary);
    font-weight: 700;
    transition: transform 0.2s ease;
}
.ffca-faq-details[open] .ffca-faq-summary::after {
    content: '−';
}
.ffca-faq-content {
    margin-top: 0.75rem;
    color: var(--ffca-slate);
    font-size: 0.95rem;
    line-height: 1.6;
}
