/* ============================================================
   SponsorMe Admin — Custom Theme Overrides for Filament 4
   Targets Filament's fi-* CSS classes and CSS custom properties.
   Loads AFTER Filament's app.css so all overrides take effect.
   ============================================================ */

/* ----------------------------------------------------------
   1. BASE / BODY
   ---------------------------------------------------------- */

.fi-body {
    background-color: #f1f5f9;
}

/* ----------------------------------------------------------
   2. SIDEBAR
   ---------------------------------------------------------- */

.fi-sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 60%, #3730a3 100%);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
}

/* Brand / logo area */
.fi-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

/* Override brand text color inside sidebar */
.fi-sidebar-header a,
.fi-sidebar-header span {
    color: #ffffff !important;
}

/* Group labels */
.fi-sidebar .fi-sidebar-group-label {
    color: rgba(199, 210, 254, 0.6) !important;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* Nav item button — clear Filament's gray-100 background */
.fi-sidebar .fi-sidebar-item-btn {
    background-color: transparent !important;
    border-radius: 0.5rem;
    margin-left: 0.375rem;
    margin-right: 0.375rem;
    transition: background 0.15s ease, color 0.15s ease;
}

/* Nav item label — override Filament's gray-700 dark text */
.fi-sidebar .fi-sidebar-item-label {
    color: rgba(199, 210, 254, 0.88) !important;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Nav item icon — override dark icon color */
.fi-sidebar .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-btn svg {
    color: rgba(199, 210, 254, 0.7) !important;
}

/* Hover state */
.fi-sidebar .fi-sidebar-item-btn:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label {
    color: #ffffff !important;
}

.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-btn:hover svg {
    color: #ffffff !important;
}

/* Active nav item — fi-active is on the <li>, not the <a> */
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn {
    background-color: rgba(255, 255, 255, 0.16) !important;
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: #ffffff !important;
    font-weight: 600;
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-btn svg {
    color: #ffffff !important;
}

/* Nav badge (count pill) */
.fi-sidebar .fi-sidebar-item-badge-ctn .fi-badge {
    background-color: rgba(255, 255, 255, 0.18) !important;
    color: #e0e7ff !important;
    font-size: 0.6875rem;
    font-weight: 600;
}

/* Group collapse / expand button */
.fi-sidebar .fi-sidebar-group-btn {
    color: rgba(199, 210, 254, 0.65) !important;
    background-color: transparent !important;
}

.fi-sidebar .fi-sidebar-group-btn:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.fi-sidebar .fi-sidebar-group-collapse-btn {
    color: rgba(199, 210, 254, 0.5) !important;
}

/* Sidebar footer */
.fi-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Account widget inside sidebar */
.fi-sidebar .fi-account-widget {
    background-color: transparent !important;
}

.fi-sidebar .fi-account-widget-user-name {
    color: #e0e7ff !important;
}

.fi-sidebar .fi-account-widget-heading {
    color: rgba(199, 210, 254, 0.7) !important;
}

/* ----------------------------------------------------------
   3. TOPBAR
   ---------------------------------------------------------- */

.fi-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.fi-topbar-ctn {
    height: 3.75rem;
}

.fi-topbar-open-sidebar-btn,
.fi-topbar-close-sidebar-btn,
.fi-topbar-open-collapse-sidebar-btn,
.fi-topbar-close-collapse-sidebar-btn {
    color: #64748b;
    border-radius: 0.375rem;
    padding: 0.375rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.fi-topbar-open-sidebar-btn:hover,
.fi-topbar-close-sidebar-btn:hover,
.fi-topbar-open-collapse-sidebar-btn:hover,
.fi-topbar-close-collapse-sidebar-btn:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

/* ----------------------------------------------------------
   4. PAGE LAYOUT — FIX THE HUGE GAP
   Filament defaults: padding-block:2rem, gap:2rem everywhere.
   We reduce these so content sits close to the header.
   ---------------------------------------------------------- */

/* The wrapper that holds breadcrumbs + fi-header */
.fi-page-header-main-ctn {
    padding-block: 0.875rem !important;
    row-gap: 0.25rem !important;
}

/* Gap between the header section and the content section */
.fi-page-main {
    gap: 0 !important;
}

/* Gap between widget rows / content blocks */
.fi-page-content {
    row-gap: 1rem !important;
    padding-bottom: 1.5rem !important;
}

/* Horizontal padding of the scrollable content column */
.fi-main {
    padding-inline: 1.5rem !important;
}

@media (min-width: 1280px) {
    .fi-main {
        padding-inline: 2rem !important;
    }
}

/* ----------------------------------------------------------
   5. PAGE HEADER — typography only, no extra spacing
   ---------------------------------------------------------- */

.fi-header {
    margin: 0 !important;
    padding-bottom: 0.875rem !important;
    border-bottom: 1px solid #e2e8f0;
}

.fi-header-heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
    .fi-header-heading {
        font-size: 1.5rem;
    }
}

.fi-header-subheading {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

/* Breadcrumbs */
.fi-breadcrumbs {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 0;
}

/* ----------------------------------------------------------
   6. SECTION CARDS
   ---------------------------------------------------------- */

.fi-section {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.fi-section-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    background-color: #fafafa;
}

.fi-section-header-heading {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
}

.fi-section-header-description {
    color: #64748b;
    font-size: 0.8125rem;
    margin-top: 0.125rem;
}

.fi-section-content {
    padding: 1.25rem 1.5rem;
}

/* ----------------------------------------------------------
   7. DATA TABLES
   ---------------------------------------------------------- */

.fi-ta-ctn {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 100%;
}

.fi-ta-content-ctn {
    width: 100%;
}

.fi-ta-header {
    padding: 0.875rem 1.25rem;
    background-color: #fafafa;
    border-bottom: 1px solid #e2e8f0;
}

.fi-ta-header-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

/* Table head cells */
.fi-ta-header-cell {
    background-color: #f8fafc;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

/* Table rows */
.fi-ta-row {
    transition: background-color 0.1s ease;
    border-bottom: 1px solid #f1f5f9;
}

.fi-ta-row:hover {
    background-color: #f5f8ff;
}

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

/* Table cells — base zero padding, vertical align */
.fi-ta-cell {
    padding: 0 !important;
    vertical-align: middle;
}

/* All column type content — reduce padding-block from 1rem to 0.5rem */
.fi-ta-text:not(.fi-inline),
.fi-ta-checkbox:not(.fi-inline),
.fi-ta-color:not(.fi-inline),
.fi-ta-toggle:not(.fi-inline),
.fi-ta-text-input:not(.fi-inline),
.fi-ta-image:not(.fi-inline),
.fi-ta-icon:not(.fi-inline),
.fi-ta-select:not(.fi-inline) {
    padding-block: 0.5rem !important;
}

/* Action cells */
.fi-ta-cell:has(.fi-ta-actions) {
    padding-block: 0.5rem !important;
}

/* Selection / checkbox cells */
.fi-ta-cell.fi-ta-selection-cell,
.fi-ta-cell:has(.fi-ta-record-checkbox) {
    padding-block: 0.5rem !important;
}

.fi-ta-cell-content {
    font-size: 0.875rem;
    color: #334155;
}

/* Search / filter toolbar */
.fi-ta-header-toolbar {
    padding: 0.875rem 1.25rem;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

/* Empty state */
.fi-ta-empty-state {
    padding: 3rem 1.5rem;
}

.fi-ta-empty-state-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.fi-ta-empty-state-description {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

/* ----------------------------------------------------------
   8. STATS OVERVIEW WIDGET
   ---------------------------------------------------------- */

.fi-wi-stats-overview-stat {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    position: relative;
}

.fi-wi-stats-overview-stat:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.fi-wi-stats-overview-stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.1;
}

.fi-wi-stats-overview-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}

.fi-wi-stats-overview-stat-description {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   9. CHART WIDGET
   ---------------------------------------------------------- */

.fi-wi-chart {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 1.25rem 1.5rem;
}

/* ----------------------------------------------------------
   10. FORM FIELDS
   ---------------------------------------------------------- */

.fi-fo-field-label-content {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.fi-fo-field-label-required-mark {
    color: #f43f5e;
}

.fi-input-wrp {
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease;
}

.fi-input-wrp:focus-within {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.fi-input {
    font-size: 0.875rem;
    color: #1e293b;
    border-radius: 0.5rem;
}

.fi-fo-field-wrp-error-message {
    font-size: 0.8125rem;
    color: #f43f5e;
    margin-top: 0.25rem;
}

/* ----------------------------------------------------------
   11. TABLE ROW ACTIONS — icon-only
   font-size:0 collapses text nodes. SVG icons use
   calc(var(--spacing)*N) rem units so they are not affected.
   currentColor is preserved so Edit/Deactivate/Delete each
   keep their indigo/warning/danger colour.
   ---------------------------------------------------------- */

.fi-ta-actions .fi-link,
.fi-ta-actions .fi-btn:not(.fi-icon-btn) {
    font-size: 0 !important;
    gap: 0 !important;
    padding-inline: 0.3125rem !important;
    padding-block: 0.3125rem !important;
    border-radius: 0.375rem;
    transition: background-color 0.12s ease;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.fi-ta-actions .fi-link:hover,
.fi-ta-actions .fi-btn:not(.fi-icon-btn):hover {
    background-color: rgba(0, 0, 0, 0.06);
}

/* Keep icon at a readable 1rem × 1rem size */
.fi-ta-actions .fi-link .fi-icon,
.fi-ta-actions .fi-btn:not(.fi-icon-btn) .fi-icon {
    width: 1rem !important;
    height: 1rem !important;
    flex-shrink: 0;
}

/* Tighten the gap between multiple action icons */
.fi-ta-actions {
    gap: 0.125rem !important;
    flex-wrap: nowrap !important;
}

/* ----------------------------------------------------------
   12. BUTTONS (general)
   ---------------------------------------------------------- */

.fi-btn {
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

/* ----------------------------------------------------------
   13. BADGES
   ---------------------------------------------------------- */

.fi-badge {
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.6rem;
}

/* ----------------------------------------------------------
   13. LOGIN PAGE
   Structure (from Filament template):
     .fi-simple-layout        → full-page gradient background
       .fi-simple-main-ctn    → transparent flex centering wrapper
         .fi-simple-main      → the white card
   ---------------------------------------------------------- */

/* Prevent any page scroll on the login screen */
body:has(.fi-simple-layout) {
    overflow: hidden;
}

/* Full-page gradient background */
.fi-simple-layout {
    background: linear-gradient(145deg, #0f0c29 0%, #1e1b4b 30%, #312e81 65%, #4338ca 100%) !important;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* Subtle decorative orbs for depth */
.fi-simple-layout::before,
.fi-simple-layout::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.fi-simple-layout::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}

.fi-simple-layout::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: -80px;
}

/* Transparent centering wrapper — do NOT add background here */
.fi-simple-main-ctn {
    background-color: transparent !important;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* The actual white card */
.fi-simple-main {
    background-color: #ffffff !important;
    border-radius: 1.25rem !important;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.4),
        0 16px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.08) !important;
    padding-inline: 2.5rem !important;
    padding-block: 2.5rem !important;
    max-width: 26rem !important;
    width: 100% !important;
    margin-block: 0 !important;
}

/* Brand heading at top of card */
.fi-simple-header {
    text-align: center;
    margin-bottom: 0.25rem;
}

.fi-simple-header-heading {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.fi-simple-header-subheading {
    color: #64748b !important;
    font-size: 0.9375rem !important;
    margin-top: 0.375rem;
}

/* Page content gap */
.fi-simple-page-content {
    row-gap: 1.25rem !important;
}

/* Mobile */
@media (max-width: 480px) {
    .fi-simple-main {
        padding-inline: 1.5rem !important;
        padding-block: 2rem !important;
        border-radius: 1rem !important;
    }
}

/* ----------------------------------------------------------
   14. MODALS
   ---------------------------------------------------------- */

.fi-modal-window {
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.fi-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.fi-modal-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.fi-modal-footer {
    padding: 1rem 1.5rem;
    background-color: #fafafa;
    border-top: 1px solid #f1f5f9;
}

/* ----------------------------------------------------------
   15. DROPDOWN
   ---------------------------------------------------------- */

.fi-dropdown-panel {
    border-radius: 0.625rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.fi-dropdown-list-item {
    font-size: 0.875rem;
    color: #334155;
    transition: background-color 0.1s ease;
}

.fi-dropdown-list-item:hover {
    background-color: #f1f5f9;
}

/* ----------------------------------------------------------
   16. RESPONSIVE — MOBILE & TABLET
   ---------------------------------------------------------- */

@media (max-width: 1023px) {
    .fi-main {
        padding-inline: 1rem !important;
    }

    .fi-page-header-main-ctn {
        padding-block: 0.75rem !important;
    }

    .fi-header-heading {
        font-size: 1.25rem;
    }

    .fi-wi-stats-overview-stat-value {
        font-size: 1.5rem;
    }

    .fi-ta-ctn {
        border-radius: 0.5rem;
    }
}

@media (max-width: 767px) {
    .fi-main {
        padding-inline: 0.75rem !important;
    }

    .fi-page-header-main-ctn {
        padding-block: 0.5rem !important;
    }

    .fi-section-content {
        padding: 1rem;
    }

    .fi-section-header {
        padding: 0.875rem 1rem;
    }

    .fi-ta-header {
        padding: 0.75rem 1rem;
    }

    .fi-ta-header-toolbar {
        padding: 0.75rem 1rem;
    }
}

/* ----------------------------------------------------------
   17. SCROLLBAR (WebKit)
   ---------------------------------------------------------- */

.fi-sidebar::-webkit-scrollbar,
.fi-main::-webkit-scrollbar {
    width: 5px;
}

.fi-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.fi-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
}

.fi-main::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

/* ----------------------------------------------------------
   18. SMOOTH TRANSITIONS
   ---------------------------------------------------------- */

.fi-sidebar,
.fi-topbar {
    transition: all 0.2s ease;
}
