/**
 * FILE SOURCE - View Styles
 */

/* Modal Styles */
.cl-modal {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cl-modal-content {
    background: #fff;
    width: 100%;
    height: 100%;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    padding: 20px;
    border-radius: 8px;
}

.cl-modal-close {
    float: right;
    cursor: pointer;
    font-size: 24px;
}

/* Access Denied Modal */
.cl-access-denied-modal {
    position: absolute;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
    box-shadow: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cl-access-denied-modal .cl-modal-content {
    background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 90vw; width: 350px; text-align: center; height: auto;
}
.cl-access-denied-modal .cl-modal-content h3 {
    color: #c00;
}

/* Restriction Modal */
.cl-restriction-modal {
    position: relative;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    border-radius: 8px;
    box-shadow: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    min-height: 420px;
}
.cl-restriction-modal .cl-modal-content {
    background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 90vw; width: 350px; text-align: center; height: auto;
}
.cl-restriction-modal input[type="password"] {
    width: 100%; padding: 0.5rem; margin: 1rem 0; font-size: 1rem;
}
.cl-restriction-modal .cl-error {
    color: red;
    margin-bottom: 1rem;
}

/* Common View Styles */
.cl-libraries {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    min-height: 420px;
}

.library-title {
    text-transform: capitalize;
}

.cl-view-wrapper .cl-view-header form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1rem;
}

.cl-view-wrapper .cl-doc-filter {
    display: flex;
    gap: 1rem;
}

.cl-view-wrapper .cl-doc-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.cl-view-wrapper .cl-view-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cl-view-wrapper {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    flex-wrap: wrap;
}

.cl-view-wrapper .cl-view-header {
    flex: 1 auto;
}

.cl-view-wrapper .cl-view-documents {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
}

.cl-view-wrapper select,
.cl-view-wrapper input[type="search"] {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
    height: 46px;
}

.cl-datatable {
    width: 100% !important;
}

.cl-view-wrapper span.recently-updated {
    display: flex;
    flex-wrap: wrap;
    background: #046bd2;
    padding: 3px 6px 3px 3px;
    border-radius: 40px;
    max-width: max-content;
    gap: 0.125rem;
    color: #fff;
    align-items: center;
    cursor: default;
    font-size: 10px;
    margin: -10px 0 10px 5px;
}
.cl-view-wrapper span.recently-updated span {
    width: 10px;
    height: 10px;
    font-size: 10px;
}
.cl-view-wrapper span.recently-updated b {
    word-break: break-word;
    text-transform: uppercase;
}
.cl-view-wrapper .modified_date {
    display: flex;
    flex-wrap: nowrap;
}

.cl-view-wrapper .cl-favorites-modal {
    position: absolute;
    background: #ffffff;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    z-index: 100;
}
.cl-view-wrapper button.cl-modal-close-btn {
    margin-left: auto;
    margin-right: 0;
}

/* Loader Styles */
.cl-view-wrapper .loader {
    width: 50px;
    aspect-ratio: 1;
    display: grid;
    border: 4px solid #0000;
    border-radius: 50%;
    border-right-color: #046bd2;
    animation: l15 1s infinite linear;
    margin: auto;
}
.cl-view-wrapper .loader::before,
.cl-view-wrapper .loader::after {
    content: "";
    grid-area: 1/1;
    margin: 2px;
    border: inherit;
    border-radius: 50%;
    animation: l15 2s infinite;
}
.cl-view-wrapper .loader::after {
    margin: 8px;
    animation-duration: 3s;
}

/* Featured/Pinned row styling */
.cl-view-wrapper tr.cl-featured-row {
    background-color: #fff9e6 !important;
    border-left: 4px solid #ffc107;
    font-weight: 600;
}
.cl-view-wrapper tr.cl-featured-row:hover {
    background-color: #fff3cd !important;
}

@keyframes l15 {
    100% { transform: rotate(1turn); }
}

@keyframes FSspin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cl-view-wrapper .cl-favorites-modal form {
    display: flex;
    gap: 1rem;
}
.cl-view-wrapper .cl-favorites-modal .cl-modal-close-btn {
    margin-bottom: 40px !important;
}
.cl-view-wrapper .cl-favorites-modal .cl-favorites-documents {
    margin-top: 30px !important;
}

/* Folder View Specifics */
.cl-folder-view-wrapper {
    display: grid;
    gap: 2rem;
}
ul.cl-folder-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
ul.cl-folder-list li {
    list-style-type: none;
}
a.cl-folder-toggle {
    text-decoration: none;
}
.cl-folder-children {
    padding: 0.5rem 0rem;
}
.clfdl_documents-table-wrapper {
    margin: 1rem 0;
}
.dataTables_wrapper {
    overflow-x: auto;
}
.cl-view-documents > ul {
    margin: 0;
}
.cl-view-documents > ul ul {
    margin-left: 1.5em;
}
.cl-folder-children a.cl-folder-toggle path {
    color: #333;
}

@media (max-width: 768px) {
    .cl-view-wrapper .cl-doc-filter {
        flex-direction: column;
    }
}

/* LearnDash Sidebar Styles */
#ldd_Sidebar.doc-panel-view {
    width: 0px;
    max-width: 450px;
    position: fixed;
    right: 0px;
    top: 0px;
    z-index: 9999;
    height: 100vh;
    background: #fff;
    padding: 60px 0px;
    box-shadow: 0px 0px 6px 0px #e1e1e1;
    box-sizing: border-box;
    overflow-x: hidden;
    pointer-events: none;
    opacity: 0;
    transition: .1s;
}

#ldd_Sidebar.doc-panel-view.ldd_Sidebar-active {
    width: 100%;
    opacity: 1;
    overflow-x: visible;
    pointer-events: all;
}

#ldd_Sidebar.doc-panel-view h3 {
    padding: 0px 20px;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul {
    padding: 20px 0 0px;
    margin: 0px;
    list-style-type: none;
    overflow-y: auto;
    height: 80vh;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul::-webkit-scrollbar {
    width: 10px;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul::-webkit-scrollbar-thumb {
    background: #888;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li {
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li:nth-child(odd) {
    background: #f5f5f5;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li a {
    padding: 0px;
    display: block;
    text-decoration: none;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li .wp-side-tble {
    display: none;
    transition: 0.01s;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li table {
    background: #fff;
    margin: 15px 0 0 0;
    width: 100%;
}

#ldd_Sidebar.doc-panel-view .ldd_sidebar ul li table tr td button {
    padding: 9px 16px;
}

#ldd_Sidebar.doc-panel-view .ldd_closebtn {
    position: absolute;
    top: 60px;
    right: 22px;
    padding: 0px;
    border-radius: 100%;
    text-decoration: none !important;
    width: 36px;
    height: 36px;
    display: inline-block;
    text-align: center;
    border: none;
    background: #eee;
    cursor: pointer;
}

.ldd_sidebar ul li h5 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0px;
}

.ldd_sidebar ul li h5 button {
    width: 24px;
    height: 24px;
    border-radius: 100%;
    display: grid;
    place-content: center;
    padding: 0px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

#ldd_main {
    position: fixed;
    bottom: 65px;
    right: 20px;
    z-index: 9998;
}

.ldd_openbtn {
    padding: 10px 15px;
    background: #046bd2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Upload Library Modal Styles */
#cl-upload-modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
}

.cl-upload-modal-inner {
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    max-width: 90vw;
    width: 350px;
    text-align: center;
    position: relative;
}

.cl-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid #ccc;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: FSspin 1s linear infinite;
}
