/* ============================================
   SPECIAL FOLDER - PROFESSIONAL CSS
   Updated version with modern design
   PHASE 1+2 UPDATES APPLIED
   ============================================ */

/* GENERAL CONTAINER */
.special-folder-container {
    max-width: 100%;
    margin: 20px 0;
}

/* ============================================
   HEADER SECTION
   ============================================ */

.special-folder-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #0073aa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-title-section h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* INFO BAR */
.folder-info-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0 0 0;
    padding: 0;
}

.folder-info-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-size: 13px;
    color: #2c3338;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.folder-info-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.folder-info-item .dashicons {
    color: #0073aa;
    font-size: 18px;
}

.folder-info-item strong {
    color: #2c3338;
}

/* ADD NEW BUTTON IN INFO BAR */
.add-new-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #0073aa 0%, #006799 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3) !important;
    transition: all 0.2s ease !important;
    margin-left: auto;
}

.add-new-button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6e 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4) !important;
}

.add-new-button .dashicons {
    font-size: 16px;
}

/* ============================================
   FILTERS SECTION - SINGLE ROW
   ============================================ */

.folder-filters-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-inline label {
    font-weight: 600;
    font-size: 13px;
    color: #2c3338;
    white-space: nowrap;
}

.filter-group-inline select,
.filter-group-inline input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: all 0.2s ease;
}

.filter-group-inline select:focus,
.filter-group-inline input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.search-group input[type="text"] {
    min-width: 250px;
}

.filter-buttons-group {
    display: flex;
    gap: 8px;
    margin-left: 0;
    align-items: center;
}

/* ============================================
   LAYOUT 2 COLUMNS - PHASE 1 UPDATE
   ============================================ */

.folder-content-section {
    display: grid;
    grid-template-columns: 240px 1fr; /* REDUCED from 320px to 240px */
    gap: 20px;
    margin-top: 20px;
}

/* ============================================
   SIDEBAR SMART FOLDERS - STICKY - PHASE 1 UPDATE
   ============================================ */

.smart-folders-sidebar {
    position: sticky;
    top: 32px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: white;
    padding: 20px; /* REDUCED from 25px */
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
}

.smart-folders-sidebar h3 {
    margin: 0 0 15px 0; /* REDUCED from 20px */
    font-size: 15px; /* REDUCED from 16px */
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 6px; /* REDUCED from 8px */
}

.smart-folders-sidebar h3 .dashicons {
    color: #0073aa;
    font-size: 18px; /* REDUCED from 20px */
}

/* Custom scrollbar */
.smart-folders-sidebar::-webkit-scrollbar {
    width: 6px; /* REDUCED from 8px */
}

.smart-folders-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.smart-folders-sidebar::-webkit-scrollbar-thumb {
    background: #0073aa;
    border-radius: 4px;
}

.smart-folders-sidebar::-webkit-scrollbar-thumb:hover {
    background: #005a87;
}

/* SMART FOLDERS LIST */
.smart-folders-list {
    list-style: none;
    margin: 0 0 15px 0; /* REDUCED from 20px */
    padding: 0;
}

.smart-folders-list li {
    margin: 0 0 6px 0; /* REDUCED from 8px */
}

.smart-folder-link {
    display: flex;
    align-items: center;
    gap: 8px; /* REDUCED from 10px */
    padding: 10px 12px; /* REDUCED from 12px 15px */
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3338;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 13px; /* ADDED for better readability */
}

.smart-folder-link:hover {
    background: #e7f3ff;
    border-color: #c5d9f1;
    transform: translateX(5px);
}

.smart-folder-link .folder-icon {
    font-size: 14px; /* REDUCED from 16px */
}

.folder-count {
    margin-left: auto;
    color: #666;
    font-size: 11px; /* REDUCED from 12px */
    background: white;
    padding: 2px 6px; /* REDUCED from 2px 8px */
    border-radius: 10px; /* REDUCED from 12px */
}

.no-folders-message {
    text-align: center;
    color: #666;
    font-size: 12px; /* REDUCED from 13px */
    padding: 15px 0; /* REDUCED from 20px */
}

/* CREATE FOLDER BUTTON */
.create-folder-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* REDUCED from 8px */
    padding: 10px 16px !important; /* REDUCED from 12px 20px */
    background: linear-gradient(135deg, #46b450 0%, #3fa048 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 13px !important; /* REDUCED from 14px */
    box-shadow: 0 2px 8px rgba(70, 180, 80, 0.3) !important;
    transition: all 0.2s ease !important;
}

.create-folder-btn:hover {
    background: linear-gradient(135deg, #3fa048 0%, #2f8c3a 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 180, 80, 0.4) !important;
}

.create-folder-btn .dashicons {
    font-size: 14px; /* REDUCED from 16px */
}

/* ============================================
   CONTENT TABLE - PHASE 1 UPDATE
   ============================================ */

.content-list-main {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto; /* ADDED for horizontal scroll when needed */
}

#content-table {
    border-radius: 8px;
    overflow: visible; /* CHANGED from hidden */
    border: 1px solid #e0e0e0;
    min-width: 100%; /* ADDED to prevent table shrinking */
    table-layout: auto; /* CHANGED from fixed for better column flexibility */
}

#content-table thead th {
    background: #f8f9fa;
    padding: 15px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #2c3338;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap; /* ADDED to prevent header wrapping */
}

#content-table tbody tr {
    transition: all 0.2s ease;
}

#content-table tbody tr:hover {
    background: #f8f9fa;
}

/* PHASE 1 - COLUMN WIDTHS UPDATE */
.check-column {
    width: 40px !important; /* FIXED WIDTH - never changes */
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center;
}

.drag-column {
    width: 30px !important; /* REDUCED from 40px - PHASE 1 */
    min-width: 30px !important;
    max-width: 30px !important;
    text-align: center;
    padding: 8px 4px !important; /* REDUCED padding */
}

/* DYNAMIC TITLE COLUMN - expands when other columns hidden */
.title-column-header,
.title-column {
    width: auto !important; /* CHANGED: auto instead of fixed */
    min-width: 400px !important; /* INCREASED minimum width */
    max-width: none !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ALL OTHER COLUMNS - fixed widths */
.author-column-header,
.author-column {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.date-column-header,
.date-column {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

.status-column-header,
.status-column {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}

.categories-column-header,
.categories-column {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

.tags-column-header,
.tags-column {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
}

.smartfolders-column-header,
.smartfolders-column {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
}

.url-column-header,
.url-column {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
}

/* URL COLUMN */
.url-column {
    padding: 8px !important;
    vertical-align: middle;
}

.folderra-url-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.folderra-url-text {
    display: inline-block;
    min-width: 0;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.4;
    color: #646970;
}

.folderra-copy-url-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    color: #2271b1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.folderra-copy-url-btn:hover {
    background: #f6f7f7;
    border-color: #2271b1;
    color: #135e96;
}

.folderra-copy-url-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.folderra-copy-url-btn.is-copied {
    color: #46b450;
    border-color: #46b450;
}

/* TABLE LAYOUT FIX */
#content-table {
    table-layout: fixed !important;
    width: max-content !important;
    min-width: 100% !important;
}

#content-table th,
#content-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PHASE 1 - DRAG HANDLE OPTIMIZATION */
.drag-handle {
    cursor: move;
    background: none;
    border: none;
    padding: 2px !important; /* REDUCED from 5px */
    color: #a0a5aa;
    transition: all 0.2s ease;
    width: 20px; /* ADDED explicit width */
    height: 20px; /* ADDED explicit height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle .dashicons {
    font-size: 16px; /* REDUCED from 20px */
}

.drag-handle:hover {
    color: #0073aa;
    transform: scale(1.1); /* REDUCED from 1.2 */
}

.sortable-row.ui-sortable-helper {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ui-sortable-placeholder {
    height: 50px !important;
    background: #e7f3ff !important;
    border: 2px dashed #0073aa !important;
    visibility: visible !important;
}

/* TITLE COLUMN */
.title-column {
    padding: 8px !important;
}

.row-title {
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-title:hover {
    color: #005a87;
}

.post-state-badge {
    display: inline-block;
    padding: 3px 8px;
    background: #f0f0f1;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
}

.title-column-header:first-child,
.title-column:first-child {
    width: auto !important;
}

/* ROW ACTIONS */
.row-actions {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

.row-actions a {
    color: #0073aa;
    text-decoration: none;
}

.row-actions a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* STATUS BADGES */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-publish {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-draft {
    background: #fff9c4;
    color: #f57f17;
}

.status-pending {
    background: #ffccbc;
    color: #e64a19;
}

.status-future {
    background: #bbdefb;
    color: #1976d2;
}

.status-private {
    background: #e1bee7;
    color: #7b1fa2;
}

/* SMART FOLDERS COLUMN - PHASE 2 */
.smartfolders-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.smartfolders-list li {
    display: inline-block;
}

.smartfolder-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e7f3ff;
    color: #0073aa;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #c5d9f1;
    transition: all 0.2s ease;
}

.smartfolder-tag:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* ============================================
   BULK ACTIONS BAR
   ============================================ */

#bulk-actions-bar {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#bulk-selected-count {
    color: #0073aa;
    font-weight: 700;
}

#bulk-folder-select {
    min-width: 200px;
}

/* ============================================
   COLUMN VISIBILITY POPUP - PHASE 2
   ============================================ */

.column-visibility-popup {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px;
    z-index: 1000;
    min-width: 220px; /* INCREASED from 200px */
}

.column-visibility-popup label {
    display: block;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.column-visibility-popup label:hover {
    background: #f8f9fa;
}

.column-visibility-popup input[type="checkbox"] {
    margin-right: 8px;
}

.column-visibility-popup label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-visibility-popup label.disabled input {
    cursor: not-allowed;
}

/* ============================================
   PAGINATION
   ============================================ */

.tablenav {
    padding: 20px 0 0 0;
    margin: 20px 0 0 0;
    border-top: 1px solid #e0e0e0;
}

.tablenav-pages {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.tablenav-pages a,
.tablenav-pages span {
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3338;
    font-size: 13px;
    transition: all 0.2s ease;
}

.tablenav-pages a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.tablenav-pages .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: 600;
}

/* ============================================
   NO CONTENT STATE
   ============================================ */

.no-content-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.no-content-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-content-message h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 20px;
}

.no-content-message p {
    margin: 0 0 25px 0;
    color: #888;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .folder-content-section {
        grid-template-columns: 1fr;
    }
    
    .smart-folders-sidebar {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .filters-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group-inline {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-buttons-group {
        margin-left: 0;
        width: 100%;
    }
    
    .search-group input[type="text"] {
        min-width: 100%;
    }
    
    #content-table {
        font-size: 12px;
    }
    
    .drag-column {
        display: none;
    }
}
/* Folderra Workflow Status */
.fold82sm-workflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 3px 10px;
    border: 1px solid var(--fold82sm-status-color, #6b7280);
    background: #fff;
    color: var(--fold82sm-status-color, #6b7280);
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    vertical-align: middle;
}
.fold82sm-workflow-badge:hover,
.fold82sm-workflow-badge.is-open {
    background: color-mix(in srgb, var(--fold82sm-status-color, #6b7280) 10%, #ffffff);
}
.fold82sm-workflow-menu {
    position: absolute;
    z-index: 100000;
    width: 220px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.14);
    padding: 10px;
}
.fold82sm-workflow-menu-title {
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    margin-bottom: 8px;
}
.fold82sm-workflow-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}
.fold82sm-workflow-option:hover,
.fold82sm-workflow-option.is-active {
    background: #f6f7f7;
}
.fold82sm-workflow-option-icon {
    width: 18px;
    text-align: center;
}


/* Workflow filter and search actions alignment */
.search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-group input[type="text"] {
    min-width: 250px;
}

.search-group .button {
    white-space: nowrap;
}

.filter-buttons-group {
    margin-left: 0;
}
