/* ==========================================================================
   LYKA FINANCIAL REPORTS DESIGN SYSTEM (Figma Pixel Perfect Styles)
   ========================================================================== */

:root {
    --lyka-primary: #072970;       /* STIX Two Text headings */
    --lyka-secondary: #008DBD;     /* Action links and active main category buttons */
    --lyka-text-dark: #1E1D19;     /* Main body text */
    --lyka-border: rgba(30, 29, 25, 0.10); /* Thin grey border */
    
    --lyka-font-sans: 'Sora', sans-serif;
    --lyka-font-serif: "STIX Two Text", serif;
    --lyka-transition: all 0.2s ease-in-out;
}

/* Reset focus outlines on categories (No focus rings/shadows as requested) */
.lyka-main-cat-btn:focus,
.lyka-main-cat-btn:active,
.lyka-sub-cat-link:focus,
.lyka-sub-cat-link:active,
.lyka-main-cats-wrapper a:focus,
.lyka-reports-wrapper a:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Allow subtle focus for dropdown select for accessibility */
.lyka-year-select:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 141, 189, 0.2) !important;
}

/* ==========================================================================
   MAIN CATEGORY TABS (gap 12px, padding 20px 28px, background #FFF / #008DBD)
   ========================================================================== */
.lyka-main-cats-wrapper {
    width: 100% !important;
    box-sizing: border-box !important;
}

.lyka-main-cats-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important; /* Prevents vertical scrollbar */
    gap: 12px !important; /* Gap between main category buttons */
    width: 100% !important;
    padding: 4px 2px 10px 2px !important;
    box-sizing: border-box !important;
    max-height: none !important;
    height: auto !important;
}

/* Main Category Button Style */
.lyka-main-cat-btn {
    display: flex !important;
    padding: 20px 28px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    border-radius: 10px !important;
    font-family: var(--lyka-font-sans) !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 100% !important; /* 16px */
    text-decoration: none !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: var(--lyka-transition) !important;
    outline: none !important;
    border: none !important; /* NO BORDER on main category buttons */
}

/* Active Main Category Button */
.lyka-main-cat-btn.active {
    background: var(--lyka-secondary) !important;
    color: #FFFFFF !important;
}

.lyka-main-cat-btn.active:hover {
    background: #0076a3 !important;
}

/* Normal / Inactive Main Category Button */
.lyka-main-cat-btn.normal {
    background: #FFFFFF !important;
    color: var(--lyka-text-dark) !important;
    opacity: 0.8 !important;
}

.lyka-main-cat-btn.normal:hover {
    opacity: 1 !important;
    background: #FDFDFD !important;
}

/* ==========================================================================
   CHILD CATEGORIES SUB-NAVIGATION (gap 32px, padding-bottom 26px)
   ========================================================================== */
.lyka-reports-wrapper {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.lyka-sub-cats-nav {
    width: 100% !important;
    box-sizing: border-box !important;
}

.lyka-sub-cats-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important; /* Prevents vertical scrollbar */
    gap: 32px !important; /* Gap between child category links */
    width: 100% !important;
    padding-bottom: 0 !important; /* Removed padding to eliminate bottom border gap */
    border-bottom: 1px solid var(--lyka-border) !important; /* horizontal border line */
    box-sizing: border-box !important;
    max-height: none !important;
    height: auto !important;
}

/* Child Category Link Style */
.lyka-sub-cat-link {
    display: flex !important;
    padding-bottom: 26px !important; /* 26px bottom padding */
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    font-family: var(--lyka-font-sans) !important;
    font-size: 16px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 100% !important; /* 16px */
    text-decoration: none !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    margin-bottom: -1px !important; /* overlaps container border line */
    border-bottom: 3px solid transparent !important;
    transition: var(--lyka-transition) !important;
    outline: none !important;
}

/* Active Child Category link */
.lyka-sub-cat-link.active {
    color: var(--lyka-text-dark) !important;
    border-bottom: 3px solid var(--lyka-text-dark) !important; /* active underline sticks to border */
    opacity: 1 !important;
}

/* Normal / Inactive Child Category link */
.lyka-sub-cat-link.normal {
    color: var(--lyka-text-dark) !important;
    border-bottom: 3px solid transparent !important;
    opacity: 0.8 !important;
}

.lyka-sub-cat-link.normal:hover {
    opacity: 1 !important;
}

/* ==========================================================================
   ACTIVE CHILD TITLE (STIX Two Text, 40px, margin-top/bottom 52px)
   ========================================================================== */
.lyka-reports-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 52px !important;    /* 52px top spacing */
    margin-bottom: 52px !important; /* 52px bottom spacing */
    gap: 20px !important;
    flex-wrap: wrap !important;
    box-sizing: border-box !important;
}

.lyka-reports-title {
    color: var(--lyka-primary) !important;
    font-family: var(--lyka-font-serif) !important;
    font-size: 40px !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 100% !important; /* 40px */
    margin: 0 !important;
}

/* Styled Year Dropdown container */
.lyka-year-filter-container {
    position: relative;
    display: inline-block;
}

.lyka-year-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #FFFFFF;
    border: 1px solid var(--lyka-border);
    border-radius: 30px;
    padding: 10px 45px 10px 24px;
    font-family: var(--lyka-font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--lyka-text-dark);
    cursor: pointer;
    transition: var(--lyka-transition);
    outline: none;
}

.lyka-year-select:hover {
    border-color: rgba(30, 29, 25, 0.3);
}

.lyka-year-filter-container::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%231E1D19' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* ==========================================================================
   THE TABLE CONTAINER & FLEXBOX ROWS (Figma exact coordinates)
   ========================================================================== */
.lyka-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    padding-bottom: 8px !important; /* Room for mobile scrollbar */
    box-sizing: border-box !important;
}

/* Table element configured as block for flex layout alignment */
.lyka-documents-table {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    border-radius: 24px !important; /* Rounded table corners - FORCED */
    border: 1px solid rgba(30, 29, 25, 0.10) !important; /* FORCED */
    background: #FFFFFF !important;
    overflow: hidden !important; /* Clips corner cells inside the rounded border - FORCED */
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border-collapse: separate !important; /* Ensures border-radius applies in all themes */
    border-spacing: 0 !important;
}

.lyka-documents-table thead,
.lyka-documents-table tbody {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Header and body rows are styled as flex containers */
.lyka-documents-table tr {
    display: flex !important;
    width: 100% !important;
    align-items: stretch !important; /* Cell heights stretch to match the tallest cell in the row */
    align-self: stretch !important;
    border-bottom: 1px solid rgba(30, 29, 25, 0.10) !important; /* Row separator border */
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
}

/* Remove bottom border from final row to prevent double border gaps */
.lyka-documents-table tr:last-child {
    border-bottom: none !important;
}
.lyka-documents-table tr:last-child td {
    border-bottom: none !important;
}

/* Table header background style */
.lyka-documents-table thead tr {
    background: #F3B956 !important;
}

/* Table cells (TH & TD) styled as flex items */
.lyka-documents-table th,
.lyka-documents-table td {
    display: flex !important;
    align-items: center !important;
    padding: 20px 50px !important; /* 20px top/bottom, 50px left/right */
    gap: 24px !important;
    box-sizing: border-box !important;
    min-height: 58px !important; /* 58px fixed height baseline */
    height: auto !important;     /* Expands if cell content wraps */
}

/* Column Dimensions (Figma exact widths) */
.lyka-documents-table th.col-sr,
.lyka-documents-table td.col-sr {
    width: 200px !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
}

.lyka-documents-table th.col-name,
.lyka-documents-table td.col-name {
    flex: 1 0 0 !important; /* Stretches to fill remaining space */
    justify-content: flex-start !important;
}

.lyka-documents-table th.col-action,
.lyka-documents-table td.col-action {
    width: 320px !important;
    flex-shrink: 0 !important;
    justify-content: flex-start !important;
}

/* Font styles - Header */
.lyka-documents-table th {
    color: var(--lyka-primary) !important;
    font-family: var(--lyka-font-serif) !important;
    font-size: 18px !important; /* Responsive font size */
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 100% !important; /* 18px */
}

/* Font styles - Body Serial Number */
.lyka-documents-table td.col-sr {
    color: var(--lyka-text-dark) !important;
    font-family: var(--lyka-font-sans) !important;
    font-size: 18px !important; /* Responsive font size */
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 100% !important; /* 18px */
}

/* Font styles - Body Document Name */
.lyka-documents-table td.col-name {
    color: var(--lyka-text-dark) !important;
    font-family: var(--lyka-font-sans) !important;
    font-size: 18px !important; /* Responsive font size */
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 120% !important; /* 21.6px */
    text-align: left !important;
}

/* Font styles - Action Link Button */
.lyka-action-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important; /* Gap between button text and arrow image */
    color: var(--lyka-secondary) !important;
    font-family: var(--lyka-font-sans) !important;
    font-size: 18px !important; /* Responsive font size */
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 100% !important; /* 18px */
    text-decoration: none !important;
    transition: var(--lyka-transition) !important;
}

.lyka-action-link:hover {
    color: #0076a3 !important;
}

/* Arrow image sizing */
.lyka-arrow-svg {
    width: 18px !important;
    height: 18px !important;
    aspect-ratio: 1/1 !important;
    object-fit: contain !important;
    transition: transform 0.2s ease-in-out !important;
}

/* Slide arrow on hover */
.lyka-action-link:hover .lyka-arrow-svg {
    transform: translateX(4px) !important;
}

/* Empty row indicator style */
.lyka-empty-row {
    justify-content: center !important;
}
.lyka-empty-row td {
    width: 100% !important;
    justify-content: center !important;
    color: var(--lyka-text-dark) !important;
    opacity: 0.6 !important;
    padding: 40px !important;
}

/* ==========================================================================
   SCROLLBAR VISIBILITY CONTROL (Only shown on mobile/tablets where overflow exists)
   ========================================================================== */

/* HIDE Scrollbars on Desktop screens (>1024px) */
@media (min-width: 1025px) {
    .lyka-main-cats-row,
    .lyka-sub-cats-row {
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* IE/Edge */
    }
    
    .lyka-main-cats-row::-webkit-scrollbar,
    .lyka-sub-cats-row::-webkit-scrollbar {
        display: none !important; /* Chrome/Safari/Edge */
    }
    
    /* Remove padding helper used for scrollbars on desktop */
    .lyka-main-cats-row {
        padding: 4px 2px 2px 2px !important;
    }
    .lyka-sub-cats-row {
        padding-bottom: 0 !important;
    }
}

/* SHOW Thin standard scrollbar on Mobile/Tablet screens (<=1024px) */
@media (max-width: 1024px) {
    .lyka-main-cats-row,
    .lyka-sub-cats-row {
        scrollbar-width: thin !important;
        scrollbar-color: rgba(30, 29, 25, 0.2) transparent !important;
    }
}

/* ==========================================================================
   RESPONSIVE FONT SCALING (18px -> 17px -> 16px -> 14px)
   ========================================================================== */

/* Laptop Resolution (1440px to 1281px) - Font goes to 17px */
@media (max-width: 1440px) {
    .lyka-documents-table th,
    .lyka-documents-table td.col-sr,
    .lyka-documents-table td.col-name,
    .lyka-action-link {
        font-size: 17px !important;
    }
}

/* Small Laptop / Tablet Landscape (1280px to 769px) - Font goes to 16px */
@media (max-width: 1280px) {
    .lyka-documents-table th,
    .lyka-documents-table td.col-sr,
    .lyka-documents-table td.col-name,
    .lyka-action-link {
        font-size: 16px !important;
    }
}

/* Mobile metadata container hidden on desktop & tablet screens (> 768px) */
.lyka-mobile-meta {
    display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE DESIGN (Up to 1024px)
   Strict 2-Column Vertical Stack (Title then Button) with High CSS Specificity
   ========================================================================== */
@media (max-width: 1024px) {
    /* Completely eradicate 3rd Action Column and Date Column on mobile/tablet */
    html body .lyka-table-container .lyka-documents-table th.col-date,
    html body .lyka-table-container .lyka-documents-table td.col-date,
    html body .lyka-table-container .lyka-documents-table th.col-action,
    html body .lyka-table-container .lyka-documents-table td.col-action {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }

    html body .lyka-table-container {
        width: 100% !important;
        overflow-x: hidden !important;
        overflow: hidden !important;
        border-radius: 16px !important;
    }

    html body .lyka-documents-table {
        min-width: 100% !important;
        width: 100% !important;
        table-layout: auto !important;
    }

    /* 2-Column Yellow Header: Sr. No. & Name */
    html body .lyka-documents-table th.col-sr {
        width: 42px !important;
        text-align: center !important;
        padding: 14px 6px !important;
        font-size: 15px !important;
    }

    html body .lyka-documents-table th.col-name {
        width: auto !important;
        text-align: left !important;
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    /* Table body cells */
    html body .lyka-documents-table tr {
        height: auto !important;
    }

    html body .lyka-documents-table td.col-sr {
        width: 42px !important;
        text-align: center !important;
        vertical-align: top !important;
        padding: 16px 4px 16px 8px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        height: auto !important;
    }

    html body .lyka-documents-table td.col-name {
        width: auto !important;
        text-align: left !important;
        vertical-align: top !important;
        padding: 16px 14px 16px 4px !important;
        height: auto !important;
        white-space: normal !important;
    }

    /* Full width document title text */
    html body .doc-title-text {
        font-size: 15px !important;
        font-weight: 500 !important;
        color: var(--lyka-text-dark, #1E1D19) !important;
        line-height: 1.45 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        display: block !important;
        width: 100% !important;
    }

    /* Action button container DIRECTLY BELOW document title text on its own line */
    html body .lyka-mobile-meta {
        display: block !important;
        margin-top: 12px !important;
        width: 100% !important;
        clear: both !important;
    }

    html body .lyka-mobile-action,
    html body .lyka-mobile-meta .lyka-action-link,
    html body .lyka-mobile-meta .lyka-download-link {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: var(--lyka-secondary, #008DBD) !important;
        text-decoration: none !important;
    }

    html body .lyka-arrow-svg,
    html body .lyka-download-arrow {
        width: 15px !important;
        height: 15px !important;
    }

    html body .lyka-reports-title {
        font-size: 32px !important;
    }
}

/* Small Mobile Screens (480px and below) */
@media (max-width: 480px) {
    .lyka-reports-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .lyka-year-filter-container {
        width: 100% !important;
    }

    .lyka-year-select {
        width: 100% !important;
    }
}

/* ==========================================================================
   SUB-CHILD CATEGORY TABS (Pills layout)
   ========================================================================== */
.lyka-sub-child-nav {
    width: 100% !important;
    margin-bottom: 25px !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.lyka-sub-child-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-bottom: 4px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.lyka-sub-child-row::-webkit-scrollbar {
    display: none !important;
}

.lyka-sub-child-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 20px !important;
    border-radius: 10px !important; /* 10px radius matching main category */
    font-family: var(--lyka-font-sans) !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    line-height: 100% !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    border: none !important; /* No border outline */
    box-shadow: none !important; /* No shadow */
}

.lyka-sub-child-link.normal {
    background: #F1F5F9 !important; /* Light grey background */
    color: #1E1D19 !important; /* Black text */
    opacity: 0.8 !important; /* 0.8 opacity */
}

.lyka-sub-child-link.normal:hover {
    background: #E2E8F0 !important; /* Slightly darker grey on hover */
    opacity: 1 !important;
}

.lyka-sub-child-link.active {
    background: var(--lyka-secondary, #008DBD) !important; /* Active blue color matching main category */
    color: #FFF !important;
}
