/* Document Library Dark Theme Styles */

.document-library-wrapper {
    padding: 30px;
    background: #2a2a2a;
    border-radius: 8px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.library-title {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

/* Filter Section */
.document-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #1f1f1f;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    align-items: center;
}

/* Hide original select elements when Nice Select is active */
.document-filters select.filter-select {
    display: none !important;
}

/* Style Nice Select dropdowns to match search input */
.document-filters .nice-select {
    padding: 10px 15px !important;
    border: 1px solid #3a3a3a !important;
    border-radius: 6px !important;
    background: #2a2a2a !important;
    color: #ffffff !important;
    font-size: 14px !important;
    min-width: 140px !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: all 0.2s !important;
    font-weight: normal !important;
    margin-bottom:0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}

.document-filters .nice-select:hover {
    border-color: #4a4a4a !important;
    background-color: #333 !important;
}

.document-filters .nice-select:focus,
.document-filters .nice-select.open {
    outline: none !important;
    border-color: #ff3333 !important;
    box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1) !important;
    background: #333 !important;
}

/* Nice Select arrow styling */
.document-filters .nice-select:after {
    /*border-color: #999 !important;*/
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: all 0.2s !important;
}

.document-filters .nice-select.open:after {
    border-color: #ff3333 !important;
}

/* Nice Select current text */
.document-filters .nice-select .current {
    color: #ffffff !important;
    font-weight: normal !important;
}

/* Nice Select dropdown list */
.document-filters .nice-select .list {
    background: #2a2a2a !important;
    border: 1px solid #3a3a3a !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
    margin-top: 5px !important;
    width: 100% !important;
}

.document-filters .nice-select .option {
    color: #ccc !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    transition: all 0.2s !important;
}
.document-filters .nice-select::after {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #d9d9d9;
    border-bottom: none;
}
.document-filters .nice-select .option:hover,
.document-filters .nice-select .option.focus,
.document-filters .nice-select .option.selected.focus {
    background-color: #333 !important;
    color: #ffffff !important;
}

.document-filters .nice-select .option.selected {
    color: #ff6666 !important;
    font-weight: 500 !important;
}

.document-filters .nice-select .option.disabled {
    color: #666 !important;
    background-color: transparent !important;
}

/* Fallback styles for regular select if Nice Select is not loaded */
.filter-select {
    padding: 10px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 14px;
    min-width: 140px;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #4a4a4a;
    background-color: #333;
}

.filter-select:focus {
    outline: none;
    border-color: #ff3333;
    box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1);
}

.search-box {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box label {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

.search-box input {
    padding: 10px 15px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    background: #2a2a2a;
    color: #ffffff;
    font-size: 14px;
    width: 280px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #ff3333;
    box-shadow: 0 0 0 3px rgba(255, 51, 51, 0.1);
    background: #333;
}

.search-box input::placeholder {
    color: #666;
}

/* Table Styles */
.document-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #1f1f1f;
    border-radius: 8px;
    overflow: hidden;
}

.document-table thead {
    background: #2a2a2a;
}

.document-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #3a3a3a;
}

.document-table tbody tr {
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.document-table tbody tr:hover {
    background: #252525;
}

.document-table tbody tr:last-child {
    border-bottom: none;
}

.document-table td {
    padding: 20px;
    font-size: 14px;
    color: #ccc;
    vertical-align: middle;
}

.column-title {
    width: 25%;
    font-weight: 500;
    color: #ffffff;
    font-size: 15px;
}

.column-summary {
    width: 45%;
    line-height: 1.7;
    color: #aaa;
}

.column-tags {
    width: 20%;
}

.column-link {
    width: 10%;
    text-align: center !important;
}

/* Tag Pills */
.tag-pill {
    display: inline-block;
    padding: 5px 14px;
    margin: 2px 4px 2px 0;
    background: rgba(255, 51, 51, 0.15);
    color: #ff6666;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: rgba(255, 51, 51, 0.25);
    color: #ff3333;
}

/* Action Buttons */
.column-link {
    gap: 8px;
    justify-content: center;
    align-items: center;
    text-align: center !important;
    width: 80px !important;
}

.btn-download,
.btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-download {
    background: rgba(255, 51, 51, 0.15);
    color: #ff6666;
}

.btn-download:hover {
    background: #ff3333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.3);
}

.btn-view {
    background: rgba(255, 51, 51, 0.15);
    color: #ff6666;
}

.btn-view:hover {
    background: #ff3333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 51, 0.3);
}

.btn-download svg,
.btn-view svg {
    width: 20px;
    height: 20px;
}

/* Clear Filters Button */
.clear-filters {
    padding: 10px 20px;
    background: rgba(255, 51, 51, 0.15);
    color: #ff6666;
    border: 1px solid rgba(255, 51, 51, 0.3);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: #ff3333;
    color: white;
    border-color: #ff3333;
}

/* No Documents Message */
.no-documents {
    text-align: center;
    padding: 60px !important;
    color: #666;
    font-style: italic;
    font-size: 15px;
}

/* Loading State */
.document-table.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.document-table.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    color: #fff;
    padding: 15px 30px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .document-library-wrapper {
        padding: 20px;
    }
    
    .document-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-select,
    .search-box input,
    .document-filters .nice-select {
        width: 100% !important;
    }
    
    .search-box {
        width: 100%;
        margin-left: 0;
    }
    
    .document-table {
        font-size: 13px;
    }
    
    .document-table th,
    .document-table td {
        padding: 12px;
    }
    
    .column-link {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .btn-download,
    .btn-view {
        width: 36px;
        height: 36px;
    }
}

/* Optional: Scrollbar Styling for Dark Theme */
.document-library-wrapper ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.document-library-wrapper ::-webkit-scrollbar-track {
    background: #1f1f1f;
    border-radius: 5px;
}

.document-library-wrapper ::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 5px;
}

.document-library-wrapper ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Table Row Selected State (if needed later) */
.document-table tr.selected {
    background: rgba(255, 51, 51, 0.1) !important;
}
