/* BillBuddy Plugin CSS
 * Contains styles for the BillBuddy WordPress plugin
 */

/*
 * Post Title Field Styling
 */
/* Classic Editor Title Field */
.post-type-billbuddy_bill #titlediv #title-prompt-text,
.post-type-billbuddy_bill #titlediv #title {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.post-type-billbuddy_bill #titlediv,
.post-type-billbuddy_bill #titlewrap {
    width: 100% !important;
    max-width: 100% !important;
}

/* Additional selectors for WordPress 5.0+ */
.post-type-billbuddy_bill .editor-styles-wrapper .editor-post-title__block,
.post-type-billbuddy_bill .editor-styles-wrapper .wp-block-post-title,
.post-type-billbuddy_bill .editor-styles-wrapper .editor-post-title__input {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Target the title input field directly */
.post-type-billbuddy_bill input[name="post_title"],
.post-type-billbuddy_bill .editor-post-title__input {
    width: 100% !important;
    max-width: none !important;
}

/*
 * Bill Details Meta Box Styling
 */
.billbuddy-meta-box {
    padding: 15px;
    max-width: 100%;
}
.billbuddy-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}
.billbuddy-meta-field {
    flex: 1;
    min-width: 200px;
}
.billbuddy-meta-field.full-width {
    flex: 0 0 100%;
    margin-top: 10px;
}
.billbuddy-meta-field.half-width {
    flex: 0 0 calc(50% - 10px);
    margin-top: 10px;
}
.billbuddy-meta-field label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #1d2327;
}
.billbuddy-field-value {
    background: #f8f9fa;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    line-height: 1.4;
}
.billbuddy-text-content {
    background: #f8f9fa;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    white-space: pre-line;
}
.billbuddy-text-content.half-height {
    max-height: 100px;
    min-height: 100px;
}

#billbuddy_category {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border-radius: 4px;
}

/*
 * Status Progress Bar Styles
 */
.bill-status-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    margin: 10px 0;
    position: relative;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f1;
    border: 2px solid #ddd;
    margin-bottom: 8px;
    z-index: 2;
}

.step-line {
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.step-label {
    font-size: 12px;
    color: #646970;
    text-align: center;
}

/* Status-specific colors */

/* Admin-specific status bar styles */
.admin-billstatus .step-held.active .step-circle,
[id^="admin-billstatus-"] .step-held.active .step-circle {
    background: #dc3545;
    border-color: #dc3545;
}

.admin-billstatus .step-held.active .step-label,
[id^="admin-billstatus-"] .step-held.active .step-label {
    color: #dc3545;
    font-weight: bold;
}

.admin-billstatus .step-comm_passed.active .step-circle,
[id^="admin-billstatus-"] .step-comm_passed.active .step-circle {
    background: #ff9107;
    border-color: #ff9107;
}

.admin-billstatus .step-comm_passed.active .step-label,
[id^="admin-billstatus-"] .step-comm_passed.active .step-label {
    color: #ff9107;
    font-weight: bold;
}

.admin-billstatus .step-floor_passed.active .step-circle,
[id^="admin-billstatus-"] .step-floor_passed.active .step-circle {
    background: #28a745;
    border-color: #28a745;
}

.admin-billstatus .step-floor_passed.active .step-label,
[id^="admin-billstatus-"] .step-floor_passed.active .step-label {
    color: #28a745;
    font-weight: bold;
}

.admin-billstatus .step-law.active .step-circle,
[id^="admin-billstatus-"] .step-law.active .step-circle {
    background: #28a745;
    border-color: #28a745;
}

.admin-billstatus .step-law.active .step-label,
[id^="admin-billstatus-"] .step-law.active .step-label {
    color: #28a745;
    font-weight: bold;
}

/* Responsive styles for mobile */
@media (max-width: 767px) {
    .bill-status-progress {
        flex-direction: column;
        padding: 20px;
    }

    .status-step {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        margin-bottom: 15px;
    }

    .step-circle {
        margin-bottom: 0;
        margin-right: 10px;
    }

    .step-label {
        font-size: 14px;
        text-align: left;
    }

    .step-line {
        position: absolute;
        left: 12px;
        top: 100%;
        width: 2px;
        height: 15px;
    }
}

/* Status line coloring utility classes for dynamic status setting */
.status-level-1 .line-0 {
    background: #dc3545;
}

.status-level-2 .line-0 {
    background: #dc3545;
}

.status-level-2 .line-1 {
    background: #ff9107;
}

.status-level-3 .line-0 {
    background: #dc3545;
}

.status-level-3 .line-1 {
    background: #ff9107;
}

.status-level-3 .line-2 {
    background: #28a745;
}

/*
 * Bill History Accordion Styles
 */
.bill-history-accordion {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.accordion-header {
    background: #f8f9fa;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    user-select: none;
}

.accordion-header label {
    margin: 0;
    font-weight: 600;
    color: #1d2327;
    cursor: pointer;
}

.toggle-icon {
    font-size: 12px;
    color: #646970;
    transition: transform 0.3s ease;
    display: inline-block;
    transform: rotate(0deg);
}

.accordion-content {
    display: none;
    padding: 15px;
    background: #fff;
}

.accordion-content:not(.hidden) {
    display: block;
}

/*
 * Admin List Table Styling
 */
.wp-list-table .column-bill_number {
    width: 15%;
}
.wp-list-table .column-chamber {
    width: 15%;
}
.wp-list-table .column-title {
    width: 55%;
}
.wp-list-table .column-introduced_date {
    width: 15%;
}
.wp-list-table .column-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Ensure the table cells also handle overflow properly */
.wp-list-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix for Bills admin page table styling */
.post-type-billbuddy_bill .wp-list-table td {
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.4;
    vertical-align: middle;
}

/* Remove gray underline from checkbox column */
.post-type-billbuddy_bill .wp-list-table th.check-column,
.post-type-billbuddy_bill .wp-list-table td.check-column {
    border-bottom: none;
}

/* Fix pagination area styling */
.post-type-billbuddy_bill .tablenav-pages .page-numbers {
    min-width: 28px;
    min-height: 28px;
}

.post-type-billbuddy_bill .tablenav-pages .page-numbers.current {
    font-weight: 600;
}

.post-type-billbuddy_bill .tablenav-pages .current-page {
    width: 45px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 3px !important;
    vertical-align: middle;
}

/*
 * Admin Dashboard Styling has been moved to admin-dashboard.css
 */

/*
 * Categories Page Styling
 */
/* Ensure categories page uses full width and has correct layout */
.billbuddy-categories.wrap {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important; /* Override any flex or grid layouts */
}

/* Make sure tables and cards use full width */
.billbuddy-categories table.wp-list-table,
.billbuddy-categories .card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Prevent scraper styles from affecting categories */
.billbuddy-categories .scraper-container,
.billbuddy-categories .scraper-column,
.billbuddy-categories .left-column,
.billbuddy-categories .right-column {
    display: block !important;
    width: 100% !important;
    flex: none !important;
}

/* Modal styles for categories page with increased specificity */
.billbuddy-categories .modal {
    display: none;
    position: fixed !important;
    z-index: 9999 !important; /* Higher z-index to ensure visibility */
    left: 0;
    top: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0,0,0,0.5);
}

.billbuddy-categories .modal-content {
    background-color: #fefefe;
    margin: 15% auto !important;
    padding: 20px;
    border: 1px solid #888;
    width: 50% !important;
    max-width: 500px !important;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative !important;
}

.delete-category {
    color: #a00;
}

.delete-category:hover {
    color: #dc3232;
    border-color: #dc3232;
}

