/* Container Layout */
.al-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
}

.al-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.al-top-left {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    gap: 8px;
}

.al-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.al-label {
    font-size: 14px;
    color: #666;
    line-height: 1;
}

.al-select-per-page {
    border: 1px solid #ccc;
    padding: 6px 12px;
    background: #fff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    height: 38px;
    display: flex;
    align-items: center;
}

.al-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.al-search-svg {
    position: absolute;
    left: 14px;
    color: #ffffff;
    pointer-events: none;
    z-index: 5;
    width: 16px;
    height: 16px;
}

.al-search-box {
    border: none;
    padding: 10px 15px 10px 42px !important;
    color: #fff;
    font-size: 14px;
    width: 220px;
    outline: none;
    height: 38px;
}

.al-search-box::placeholder {
    color: rgba(255, 255, 255, 0.85);
}

.al-btn-download-selected {
    border: none;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
}

.al-btn-download-selected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Table horizontal scrolling fixes */
.al-table-container {
    border: 1px solid #e1dcd5;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.al-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.al-table-header th {
    padding: 18px 20px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid #e1dcd5;
}

.al-table-row {
    border-bottom: 1px solid #f2ede6;
}

.al-table-row:last-child {
    border-bottom: none;
}

.al-table td {
    padding: 15px 20px;
    font-size: 14px;
    vertical-align: middle;
}

.al-col-checkbox {
    width: 50px;
    text-align: center;
}

.al-col-checkbox input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.al-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.al-mp3-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.al-col-download {
    text-align: center;
    width: 120px;
}

.al-btn-row-download {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline: none;
    box-shadow: none !important;
}

.al-download-svg {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Strictly Remove Download Hover Effects */
.al-btn-row-download:hover,
.al-btn-row-download:focus,
.al-download-svg:hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
    background: none !important;
    transition: none !important;
    opacity: 1 !important;
    cursor: pointer;
}

/* Bottom Pagination & Bar on bottom-right */
.al-bottom-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Perfect Square Box Pagination */
.al-pagination {
    display: flex;
    gap: 5px;
}

.al-pagination .al-page-link {
    border: 1px solid #e1dcd5;
    padding: 8px 14px;
    background: #fff;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    border-radius: 0 !important; /* Forces perfect square */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    transition: all 0.2s;
}

.al-pagination .al-page-link:hover {
    background: #fbf8f2;
}

.al-pagination .al-page-link.active {
    border-color: transparent;
    font-weight: bold;
}

/* Mobile responsive layout fixes */
@media (max-width: 768px) {
    .al-top-left {
        display: none !important; /* Hide Display Per Page completely */
    }
    .al-top-bar {
        display: block !important;
        width: 100% !important;
    }
    .al-top-right {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 10px !important;
    }
    .al-search-wrapper {
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
    }
    .al-search-box {
        width: 100% !important;
        max-width: 100% !important;
    }
    .al-btn-download-selected {
        flex: 1 1 50% !important;
        width: 50% !important;
        max-width: 50% !important;
        justify-content: center !important;
        font-size: 13px !important;
        padding: 10px !important;
    }
    .al-col-author {
        display: none !important;
    }
    .al-table {
        min-width: 550px !important; /* Ensure table forces side scroll on tiny screens without squishing column contents */
    }
}

@media (max-width: 480px) {
    .al-container {
        margin: 5px 0;
    }
    .al-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    .al-mp3-icon, .al-download-svg {
        width: 20px;
        height: 20px;
    }
    .al-btn-download-selected {
        font-size: 12px !important;
    }
}
