/**
 * InsidePiano — Dropfiles: Downloads Page, Table, Filter Bar
 */

/* ============================================
   DOWNLOADS PAGE — Category Dropdown
   ============================================ */

select.custom-dropdown {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-block !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: 340px !important;
    padding: 0.75rem 3rem 0.75rem 1.25rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: #c8c8cd !important;
    background-color: #1F1F21 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23939397' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 16px !important;
    border: 1px solid #3d3d45 !important;
    border-radius: 0.5rem !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.5 !important;
}

select.custom-dropdown:focus {
    border-color: #7367f0 !important;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15) !important;
    outline: none !important;
}

select.custom-dropdown option {
    background-color: #1F1F21 !important;
    color: #c8c8cd !important;
    font-weight: 400 !important;
}

/* ============================================
   DROPFILES — Descargar Apps / Downloads Page
   Scoped to .dropfiles-content for safety
   ============================================ */

/* Outer wrapper: Conca card */
.dropfiles-content {
    background-color: #1F1F21 !important;
    border-radius: 0.75rem !important;
    border: 1px solid #2e2e33 !important;
    overflow: visible !important;
    margin-top: -1.5rem !important;
    padding-top: 0 !important;
}

/* Category header + container — hidden for compact layout */
.dropfiles-content .categories-head,
.dropfiles-content .dropfiles-categories {
    display: none !important;
}

/* Remove container top margin now that the header is gone */
.dropfiles-content .dropfiles-container {
    margin-top: 0 !important;
}

/* Settings gear / column toggle menu — hide it */
.dropfiles-content .mediaTableMenu {
    display: none !important;
}

/* Table wrapper padding */
.dropfiles-content .mediaTableWrapper {
    padding: 0.25rem 1.75rem 1.5rem 1.75rem !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* Base table resets */
.dropfiles-content .mediaTable {
    width: 100% !important;
    border-collapse: collapse !important;
    background-color: transparent !important;
    border: none !important;
    margin: 0 !important;
}

/* Kill Bootstrap table-bordered borders */
.dropfiles-content .mediaTable,
.dropfiles-content .mediaTable th,
.dropfiles-content .mediaTable td,
.dropfiles-content .mediaTable tr {
    border: none !important;
    box-shadow: none !important;
}

/* Table header row */
.dropfiles-content .mediaTable thead tr {
    border-bottom: 1px solid #2e2e33 !important;
    background: transparent !important;
}

.dropfiles-content .mediaTable thead th {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    color: #939397 !important;
    padding: 0.5rem 0.75rem !important;
    white-space: nowrap !important;
    background: transparent !important;
}

/* Clip hover highlight inside the card corners */
.dropfiles-content .mediaTable tbody tr.file:first-child td:first-child { border-top-left-radius: 0.5rem !important; }
.dropfiles-content .mediaTable tbody tr.file:first-child td:last-child  { border-top-right-radius: 0.5rem !important; }
.dropfiles-content .mediaTable tbody tr.file:last-child td:first-child  { border-bottom-left-radius: 0.5rem !important; }
.dropfiles-content .mediaTable tbody tr.file:last-child td:last-child   { border-bottom-right-radius: 0.5rem !important; }

/* Body rows */
.dropfiles-content .mediaTable tbody tr.file {
    border-bottom: 1px solid #2e2e33 !important;
    background-color: transparent !important;
    transition: background-color 0.15s ease !important;
}

.dropfiles-content .mediaTable tbody tr.file:last-child {
    border-bottom: none !important;
}

.dropfiles-content .mediaTable tbody tr.file:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* Kill Bootstrap striped rows and table-hover white flash */
.dropfiles-content .mediaTable {
    --bs-table-bg: transparent !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03) !important;
    --bs-table-hover-color: #c8c8cd !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-active-bg: transparent !important;
}

.dropfiles-content .mediaTable.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-bg-state: transparent !important;
}

/* Override the Conca/Bootstrap .table.table-hover .btn-icon:hover white rule */
.dropfiles-content .mediaTable.table-hover > tbody > tr:hover > * {
    background-color: transparent !important;
    --bs-table-bg-state: rgba(255, 255, 255, 0.03) !important;
    color: #c8c8cd !important;
}

/* Table cells — beat style_ver5.4.css .dropfiles-content-table.dropfiles-content .table-bordered td { background: #fff } */
.dropfiles-content-table.dropfiles-content .mediaTable td,
.dropfiles-content-table.dropfiles-content .table-bordered td {
    padding: 0.875rem 0.75rem !important;
    vertical-align: middle !important;
    color: #c8c8cd !important;
    font-size: 0.875rem !important;
    background-color: transparent !important;
    line-height: inherit !important;
    border: none !important;
}

/* Kill the !important white-on-hover from style_ver5.4.css — extra specificity via element types */
.dropfiles-content-table.dropfiles-content table.table-striped tbody > tr:hover td,
.dropfiles-content-table.dropfiles-content table.table-hover tbody tr:hover > td,
.dropfiles-content-table.dropfiles-content table.table-hover tbody tr:hover > th,
.dropfiles-content-table.dropfiles-content table.mediaTable tbody tr.file:hover td {
    background-color: rgba(255, 255, 255, 0.03) !important;
    color: #c8c8cd !important;
}

/* Title cell: icon + filename */
/* NOTE: do NOT use display:flex here — it breaks td height and causes hover gap */
.dropfiles-content .mediaTable td.extcol {
    min-width: 200px !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.dropfiles-content .mediaTable td.extcol .ext {
    vertical-align: middle !important;
    margin-right: 0.75rem !important;
}

.dropfiles-content .mediaTable td.extcol a.title {
    vertical-align: middle !important;
    white-space: normal !important;
}

/* ext badge — replace Dropfiles sprite with Bootstrap Icons glyph */
.dropfiles-content .mediaTable .ext {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    background-image: none !important;  /* kill Dropfiles sprite */
    border: none !important;
    font-size: 0 !important;
    position: relative !important;
}

/* Hide the inner file type text */
.dropfiles-content .mediaTable .ext span {
    display: none !important;
}

/* Icon colors per type — icons injected via JS below */
.dropfiles-content .mediaTable .ext.pdf {
    background-color: rgba(234, 84, 85, 0.1) !important;
}
.dropfiles-content .mediaTable .ext.pdf .bi {
    color: #ea5455 !important;
    font-size: 1.1rem !important;
}

.dropfiles-content .mediaTable .ext.zip {
    background-color: rgba(115, 103, 240, 0.1) !important;
}
.dropfiles-content .mediaTable .ext.zip .bi {
    color: #7367f0 !important;
    font-size: 1.1rem !important;
}

.dropfiles-content .mediaTable .ext:not(.pdf):not(.zip) {
    background-color: rgba(115, 103, 240, 0.1) !important;
}
.dropfiles-content .mediaTable .ext:not(.pdf):not(.zip) .bi {
    color: #7367f0 !important;
    font-size: 1.1rem !important;
}

/* Filename link */
.dropfiles-content .mediaTable a.title {
    color: #c8c8cd !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: color 0.15s ease !important;
}

.dropfiles-content .mediaTable a.title:hover {
    color: #7367f0 !important;
}

/* Size & hits cells */
.dropfiles-content .mediaTable td.file-size,
.dropfiles-content .mediaTable td.file-hits {
    color: #939397 !important;
    font-size: 0.8125rem !important;
    white-space: nowrap !important;
}

/* Download button — beat Dropfiles specificity: .dropfiles-content .downloadlink:not(.noLightbox) */
.dropfiles-content table.mediaTable a.downloadlink:not(.noLightbox),
.dropfiles-content table.mediaTable a.dropfiles_downloadlink {
    margin-right: 0.25rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 16px !important;
    background: rgba(115, 103, 240, 0.15) !important;
    border: 1px solid rgba(115, 103, 240, 0.4) !important;
    border-radius: 6px !important;
    color: #7367f0 !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;
}

.dropfiles-content table.mediaTable a.downloadlink:not(.noLightbox):hover,
.dropfiles-content table.mediaTable a.dropfiles_downloadlink:hover {
    background: rgba(115, 103, 240, 0.28) !important;
    border-color: #7367f0 !important;
    color: #9f92fe !important;
    box-shadow: none !important;
}

/* zmdi cloud-download icon inside button */
.dropfiles-content .mediaTable a.downloadlink i,
.dropfiles-content .mediaTable a.dropfiles_downloadlink i {
    font-size: 1rem !important;
    color: inherit !important;
    line-height: 1 !important;
}

/* Hide article title and info (author, category, date, hits) on download pages */
.item-page .page-header,
.item-page dl.article-info {
    display: none !important;
}

/* Fix uneven spacing in download table */
.mediaTableWrapper {
    padding: 24px 28px !important;
}

.dropfiles-content {
    padding: 0px !important;
    margin: 0px !important;
}

/* Preview button — hidden */
.dropfiles-content a.openlink.dropfileslightbox {
    display: none !important;
}

/* Filter bar — reduce gap between dropdown and content below */
.filter-bar.mb-4 {
    margin-bottom: 0.15rem !important;
}

/* ============================================================
   DROPFILES / APPS PAGE — transparent wrapper card
   The .demo-card wraps the article on every com_content page.
   When the article contains .dropfiles-content (its own card),
   strip the outer wrapper so there's no double-card effect.
   ============================================================ */
.demo-card:has(.dropfiles-content) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.demo-card:has(.dropfiles-content) .demo-card-body {
    padding: 0 !important;
}

/* Reset the negative margin-top that was compensating for the old card layout */
.demo-card:has(.dropfiles-content) .dropfiles-content {
    margin-top: 0 !important;
}


