/* Styles for Scheduled Blogs component */
.blog82ai-scheduled-blogs {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.blog82ai-scheduled-blogs .blog82ai-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e1e1e1;
    padding-bottom: 10px;
}
.blog82ai-scheduled-blogs .header-actions .button {
    margin-left: 10px;
}
.blog82ai-scheduler-section {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}
.blog82ai-scheduler-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
}
.blog82ai-scheduler-section .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}
.blog82ai-scheduler-section .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-width: 150px;
}
.blog82ai-scheduler-section .form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #23282d;
    font-size: 14px;
}
.blog82ai-scheduler-section .form-group select,
.blog82ai-scheduler-section .form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    height: 46px;
    box-sizing: border-box;
}
.blog82ai-scheduled-blogs-table .form-group select,
.blog82ai-scheduled-blogs-table.form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    height: 46px;
    box-sizing: border-box;
}
.blog82ai-scheduled-blogs-table .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-width: 150px;
}
.blog82ai-scheduler-section .form-group button {
    height: 38px;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background: #0073aa;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.blog82ai-scheduler-section .form-group button:hover {
    background: #005a87;
}
.blog82ai-scheduled-blogs-table {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}
.blog82ai-scheduled-blogs-table h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}
/* Basic filter bar - v5 - Single line alignment */
.blog82ai-table-filters {
    background: #fff !important;
    margin-top: 20px !important;
    margin-bottom: 15px !important;
   
    align-items: flex-end !important;
    gap: 15px !important;
    flex-wrap: nowrap !important;
}

.blog82ai-table-filters .filter-group {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    min-width: 0 !important;
}
.blog82ai-table-filters .form-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}
.blog82ai-table-filters .filter-group:last-child {
    margin-left: auto !important;
    margin-right: 0 !important;
    padding-top: 0 !important;
}

.blog82ai-table-filters label {
    display: block !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    font-size: 13px !important;
    color: #1d2327 !important;
    white-space: nowrap !important;
}

.form-group .button{
    height: 46px !important;
}
.blog82ai-table-filters input[type="text"] {
    height: 46px !important;
    padding: 4px 8px !important;
    border: 1px solid #ddd !important; /* match selects */
    background: #fff !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
}
/* make focus consistent with other controls */
.blog82ai-table-filters input[type="text"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 1px rgba(34,113,177,0.12), 0 0 0 3px rgba(34,113,177,0.06) !important;
    border-color: #2271b1 !important;
}

.blog82ai-table-filters button {
    height: 40px !important;
    padding: 0 12px !important;
    border: 1px solid #2271b1 !important;
    background: #2271b1 !important;
    color: #fff !important;
    font-size: 13px !important;
    cursor: pointer !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    border-radius: 3px !important;
}

.blog82ai-table-filters button:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

/* Override: make Clear Filters (and filter area buttons) slightly smaller to match inputs */
.blog82ai-table-filters .form-group .button {
    height: 36px !important;
    padding: 4px 10px !important;
}

/* Table styling to match screenshot */
.blog82ai-scheduled-blogs-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background: #fff;
}

/* Table wrapper to prevent layout break on small screens */
.blog82ai-schedule-table-wrapper {
    overflow-x: auto;
}

/* Header styling */
.blog82ai-scheduled-blogs-table thead th {
    background: #f8f9fa;
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    text-align: left;
}

.blog82ai-scheduled-blogs-table thead th:first-child {
    border-top-left-radius: 8px;
    width: 40px;
    text-align: center;
}

.blog82ai-scheduled-blogs-table thead th:last-child {
    border-top-right-radius: 8px;
}

/* Body styling - no borders, clean rows */
.blog82ai-scheduled-blogs-table tbody tr {
    border: none;
    background: #fff;
    transition: background-color 0.15s ease;
}

.blog82ai-scheduled-blogs-table tbody tr:hover {
    background: #f8f9fa;
}

.blog82ai-scheduled-blogs-table tbody tr:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.blog82ai-scheduled-blogs-table tbody td {
    padding: 16px;
    border: none;
    vertical-align: middle;
    font-size: 14px;
    color: #495057;
}

.blog82ai-scheduled-blogs-table tbody td:first-child {
    text-align: center;
    width: 40px;
}

/* Category column styling */
.blog82ai-scheduled-blogs-table tbody td:nth-child(2) {
    font-weight: 600;
    color: #2c3e50;
}

.blog82ai-scheduled-blogs-table .row-actions {
    margin-top: 4px;
    font-size: 12px;
}

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

.blog82ai-scheduled-blogs-table .row-actions a:hover {
    color: #005a87;
}

/* Status badges */
.blog82ai-scheduled-blogs-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog82ai-scheduled-blogs-table .status-active {
    background: #d4edda;
    color: #155724;
}

.blog82ai-scheduled-blogs-table .status-paused {
    background: #fff3cd;
    color: #856404;
}

.blog82ai-scheduled-blogs-table .status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* Action buttons */
.blog82ai-scheduled-blogs-table .button-small {
    padding: 6px 10px;
    font-size: 12px;
    margin-right: 6px;
    border-radius: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.blog82ai-scheduled-blogs-table .button-small:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.blog82ai-scheduled-blogs-table .button-small .dashicons {
    vertical-align: middle;
    line-height: 1;
}

.blog82ai-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}
.blog82ai-bulk-actions select {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccd0d4;
}
.blog82ai-schedule-stats {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}
.blog82ai-schedule-stats h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}
.blog82ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* Ensure four stats boxes align in a single row on wider admin screens */
@media (min-width: 1100px) {
    .blog82ai-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.blog82ai-stat-item {
    text-align: center;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
}
.blog82ai-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 5px;
}
.blog82ai-stat-label {
    font-size: 14px;
    color: #666;
}
.blog82ai-stat-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .blog82ai-scheduler-section .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog82ai-scheduler-section .form-group {
        min-width: auto;
        width: 100%;
    }
    
    .blog82ai-table-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog82ai-table-filters .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .blog82ai-table-filters .filter-group input[type="text"] {
        min-width: auto;
        width: 100%;
    }
    
    .blog82ai-stats-grid {
        /* Keep 4 columns but allow horizontal scroll on very small screens */
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
    }
}

/* Force items to be shrinkable and allow horizontal overflow if container is too narrow */
.blog82ai-schedule-stats {
    overflow-x: auto;
}
.blog82ai-stat-item {
    min-width: 0;
}

/* Compact styles for small screens to avoid horizontal scrolling while keeping 4 boxes on one line */
@media (max-width: 600px) {
    .blog82ai-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }
    .blog82ai-stat-item {
        padding: 10px;
    }
    .blog82ai-stat-value {
        font-size: 18px;
    }
    .blog82ai-stat-label {
        font-size: 12px;
    }
    .blog82ai-stat-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    .blog82ai-schedule-stats {
        overflow-x: visible; /* disable forced horizontal scroll */
    }
}

@media (max-width: 420px) {
    .blog82ai-stat-item {
        padding: 8px;
    }
    .blog82ai-stat-value {
        font-size: 16px;
    }
    .blog82ai-stat-label {
        font-size: 11px;
    }
    .blog82ai-stat-icon {
        font-size: 18px;
        margin-bottom: 4px;
    }
}

/* Moved from src/AIBlog/ScheduledBlog/ScheduledBlog.php: Active Schedules filter tweaks */
.blog82ai-table-filters{
    display:flex;
    gap:16px;
    flex-wrap:wrap !important;
    align-items:center !important; /* center labels and controls */
    padding:12px;
    border:1px solid #e6e6e6;
    border-radius:4px;
    background:#fff;
    margin-bottom:12px;
}
.blog82ai-table-filters .form-row{
    display:flex;
    gap:12px;
    flex-wrap:wrap !important;
    margin:0;
    align-items:flex-end !important; /* align controls to same baseline */
}
.blog82ai-table-filters .form-group{
    min-width:160px;
    flex:0 0 auto;
    display:flex;
    flex-direction:column;
    gap:6px;
    margin:0;
}
.blog82ai-table-filters .form-group label{margin:0 0 6px 0;font-size:13px;display:block}
/* Make the search box flexible so it expands to fill available space */
.blog82ai-table-filters .form-group input[type="text"]{
    flex:1 1 260px;
    min-width:120px;
    width:100%;
    padding:6px 8px;
    border:1px solid #ddd;
    border-radius:4px;
    box-sizing:border-box;
    height:40px !important; /* normalize height */
    max-height:40px !important;
    line-height:20px !important;
    font-size:13px;
}
.blog82ai-table-filters .form-group select{
    /* Hold a desktop width but allow shrinking on smaller screens */
    flex: 0 0 220px;
    max-width:100%;
    padding:6px 8px;
    border:1px solid #ddd;
    border-radius:4px;
    box-sizing:border-box;
    height:40px !important; /*normalize select height to match inputs */
    max-height:40px !important;
    line-height:20px !important;
}
.blog82ai-table-filters .form-group button{align-self:flex-start}
@media (max-width:900px){
    .blog82ai-table-filters{flex-direction:column;align-items:stretch}
    .blog82ai-table-filters .form-row{flex-direction:column;align-items:stretch}
    .blog82ai-table-filters .form-group{width:100%}
    .blog82ai-table-filters .form-group select{width:100%}
}
