/* ==========================================================================
   Resource Manager Page Styles - V2 (Professional Focus)
   ========================================================================== */

/* --- General Container & Typography --- */

.drip-core-page .drip-core-container {
    max-width: 80%;
    margin: 2rem auto;
    padding: 1rem 1.5rem; /* Slightly more horizontal padding */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; /* Common WP Admin font stack */
    font-size: 14px; /* Smaller base font size for container */
    color: #333;
    line-height: 1.6;
}

.drip-core-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem; /* Increased spacing */
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee; /* Subtle separator */
    flex-wrap: wrap;
    gap: 1rem;
}

.drip-core-header .entry-title {
    font-size: 1.8em; /* Slightly smaller than default H1 maybe */
    font-weight: 600;
    margin: 0;
    color: #1d2327; /* Darker heading color */
}

/* Primary Button Styling (Add New) */
.add-new-resource-button {
    display: inline-flex; /* Align icon and text nicely */
    align-items: center;
    background-color: #0073aa; /* Standard WP Blue */
    color: #fff;
    border: 1px solid #0073aa;
    border-radius: 3px;
    padding: 8px 15px;
    font-size: 13px; /* WP Admin button size */
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out;
}
.add-new-resource-button:hover,
.add-new-resource-button:focus {
    background-color: #005a87;
    border-color: #005a87;
    color: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.add-new-resource-button .dashicons {
    margin-right: 6px;
    height: 18px; /* Match font size better */
    width: 18px;
    font-size: 18px;
}


/* --- Filter Section --- */

.resource-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Wider min width */
    gap: 1rem 1.5rem; /* More horizontal gap */
    padding: 1.5rem;
    background-color: #fdfdfd; /* Very light background */
    border: 1px solid #e5e5e5; /* Lighter border */
    border-radius: 4px;
    margin-bottom: 2.5rem; /* More spacing below filters */
}

.resource-filters .filter-group {
    display: flex;
    flex-direction: column;
}

.resource-filters label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 12px; /* Smaller label */
    color: #50575e; /* WP Admin label color */
    text-transform: uppercase; /* Optional: Uppercase labels */
    letter-spacing: 0.5px;
}

.resource-filters input[type="text"] {
    padding: 8px 10px; /* Adjusted padding */
    border: 1px solid #ccd0d4; /* WP Admin input border */
    border-radius: 3px;
    font-size: 14px; /* Match container font size */
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04) inset;
    transition: border-color 0.2s ease-in-out;
    color: #333;
}
.resource-filters input[type="text"]::placeholder {
    color: #a0a5aa; /* Lighter placeholder */
    font-size: 13px;
}
.resource-filters input[type="text"]:focus {
    border-color: #007cba; /* WP focus blue */
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Secondary Button Styling (Clear Filters) */
.resource-filters .filter-actions {
    justify-content: flex-end;
    align-items: flex-end;
}
#clear-filters {
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    color: #555;
    border-radius: 3px;
    padding: 7px 12px; /* Slightly smaller */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
#clear-filters:hover,
#clear-filters:focus {
    background-color: #f0f0f0;
    border-color: #999;
    color: #333;
    outline: none;
}

/* --- Table Styling --- */

.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem; /* Space before pagination */
    border: 1px solid #e5e5e5; /* Border around the scrollable area */
    border-radius: 3px;
}

.resource-table {
    width: 100%;
    border-collapse: collapse;
    border: none; /* Remove inner border, rely on row borders */
    font-size: 13px; /* Slightly smaller table font */
}

.resource-table thead {
    background-color: #f9f9f9; /* Lighter header background */
    color: #333;
    text-align: left;
    border-bottom: 1px solid #e5e5e5; /* Header separator */
}

.resource-table th {
    padding: 10px 12px; /* Reduced padding */
    font-weight: 600;
    text-transform: none; /* Normal case headers */
    letter-spacing: 0;
    color: #444; /* Dark grey header text */
}

.resource-table tbody tr {
    border-bottom: 1px solid #f0f0f0; /* Lighter row separator */
    background-color: #ffffff;
    transition: background-color 0.15s ease-in-out;
}
/* Remove border from last row */
.resource-table tbody tr:last-child {
    border-bottom: none;
}
/* No alternating colors for a cleaner look, rely on hover */
/* .resource-table tbody tr:nth-child(even) { background-color: #fcfcfc; } */

.resource-table tbody tr:hover {
    background-color: #f5faff; /* Very subtle blue hover */
}

.resource-table td {
    padding: 10px 12px; /* Match header padding */
    vertical-align: middle; /* Align text vertically centered */
    color: #444; /* Slightly lighter text color */
}

.resource-table .col-title a {
    font-weight: 600;
    color: #0073aa; /* WP Blue link */
    text-decoration: none;
    display: inline-block; /* Prevents status span weirdness */
}
.resource-table .col-title a:hover {
    color: #005a87;
    text-decoration: underline;
}

.resource-table .post-status {
    font-size: 0.9em; /* Relative to td font size */
    font-style: normal; /* No italics */
    color: #787c82; /* WP subtle text color */
    margin-left: 6px;
    white-space: nowrap;
    font-weight: normal; /* Ensure not bold */
}

/* View Details as Text Link (less visually heavy than button) */
.resource-table .col-link a {
    /* display: inline-block; */ /* Remove if you prefer default link flow */
    /* background-color: #f7f7f7; */
    /* border: 1px solid #ccc; */
    /* border-radius: 3px; */
    /* padding: 4px 8px; */
    /* font-size: 12px; */
    /* color: #555; */
    /* text-decoration: none; */
    /* white-space: nowrap; */
    /* transition: background-color 0.2s ease, border-color 0.2s ease; */
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
}
.resource-table .col-link a:hover {
    /* background-color: #f0f0f0; */
    /* border-color: #999; */
    /* color: #333; */
    text-decoration: underline;
}

/* No Results Row */
.resource-table tr.no-results td {
    text-align: center;
    padding: 2.5rem 1rem; /* More padding */
    font-size: 14px; /* Slightly larger text */
    color: #787c82; /* Subtle text color */
    background-color: #fdfdfd; /* Match filter background */
}

/* --- Pagination --- */

.resource-pagination {
    margin-top: 2.5rem; /* Increased spacing */
    text-align: center;
}
.resource-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px; /* Adjusted padding */
    margin: 0 3px;
    border: 1px solid #dcdcde; /* Lighter border */
    border-radius: 3px;
    text-decoration: none;
    color: #0073aa; /* Link blue */
    background-color: #fff;
    font-size: 13px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.resource-pagination .page-numbers:hover {
    background-color: #f0f0f0; /* Subtle hover */
    border-color: #ccc;
    color: #005a87; /* Darker blue */
}
.resource-pagination .page-numbers.current {
    background-color: #f0f0f0; /* Current page background */
    border-color: #ccc;
    color: #1d2327; /* Dark text */
    font-weight: 600; /* Bold current page */
    cursor: default;
}
.resource-pagination .prev,
.resource-pagination .next {
    /* Additional styling if needed */
}


/* --- Responsive Adjustments --- */

@media (max-width: 960px) {
    .resource-filters {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Adjust minmax */
        gap: 1rem; /* Reduce gap */
    }
}

@media (max-width: 768px) {
    .drip-core-page .drip-core-container {
        padding: 1rem; /* Reduce padding */
    }
    .drip-core-header {
        flex-direction: column;
        align-items: flex-start; /* Align items left */
    }
    .drip-core-header .entry-title {
        font-size: 1.6em; /* Reduce title size */
    }
    .resource-filters {
        grid-template-columns: 1fr 1fr; /* Two columns */
    }
    .resource-filters .filter-actions {
        grid-column: 1 / -1; /* Make button span full width */
        align-items: center; /* Center button */
    }
    #clear-filters {
        width: 100%; /* Full width button */
        text-align: center;
    }

    /* Responsive Table: Hide header, use data-labels */
    .resource-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }
    .resource-table tr {
        display: block;
        margin-bottom: 1.5rem; /* Space between card-like rows */
        border: 1px solid #e5e5e5;
        border-radius: 3px;
        background-color: #fff; /* Ensure background */
    }
    .resource-table tbody tr:last-child {
        margin-bottom: 0; /* No margin on last one */
    }
    .resource-table td {
        display: block;
        text-align: right; /* Align content right */
        padding-left: 40%; /* Make space for the label */
        position: relative;
        border-bottom: 1px dotted #eee; /* Separator between cells */
        vertical-align: middle; /* Re-center */
    }
    .resource-table td:last-child {
        border-bottom: none;
    }
    .resource-table td::before {
        content: attr(data-label); /* Get label from data attribute */
        position: absolute;
        left: 10px;
        width: calc(40% - 20px); /* Calculate label width */
        font-weight: 600;
        text-align: left;
        color: #1d2327; /* Darker label color */
    }
    .resource-table td.col-link {
        padding-left: 10px; /* Remove padding override for link */
        text-align: center; /* Center the link */
    }
    .resource-table td.col-link::before {
        content: ""; /* Hide label for link */
    }
}

@media (max-width: 480px) {
    .resource-filters {
        grid-template-columns: 1fr; /* Single column filters */
    }
    .drip-core-header .entry-title {
        font-size: 1.5em;
    }
    .add-new-resource-button {
        width: 100%; /* Full width button */
        justify-content: center;
    }
    .resource-table td {
        padding-left: 10px;
        text-align: left; /* Align left on smallest */
    }
    .resource-table td::before {
        position: static; /* Label above content */
        display: block;
        width: auto;
        margin-bottom: 5px;
        font-weight: 600;
        color: #1d2327;
    }
}

/* --- Filter Section --- */

.resource-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Wider min width */
    gap: 1rem 1.5rem; /* More horizontal gap */
    padding: 1.5rem;
    background-color: #fdfdfd; /* Very light background */
    border: 1px solid #e5e5e5; /* Lighter border */
    border-radius: 4px;
    margin-bottom: 2.5rem; /* More spacing below filters */
}

.resource-filters .filter-group {
    display: flex;
    flex-direction: column;
}

.resource-filters label {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 12px; /* Smaller label */
    color: #50575e; /* WP Admin label color */
    text-transform: uppercase; /* Optional: Uppercase labels */
    letter-spacing: 0.5px;
}

/* Combined styles for text, number, and select inputs */
.resource-filters input[type="text"],
.resource-filters input[type="number"],
.resource-filters select {
    padding: 8px 10px;
    border: 1px solid #ccd0d4; /* WP Admin input border */
    border-radius: 3px;
    font-size: 14px; /* Match container font size */
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04) inset;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Added box-shadow transition */
    color: #333;
    height: 32px; /* Explicit height for better alignment */
    line-height: normal; /* Reset line-height for inputs/select */
    box-sizing: border-box; /* Include padding and border in height */
}

/* Specific styles for select if needed (e.g., background arrow - using browser default here) */
.resource-filters select {
    /* appearance: none; */ /* Uncomment to remove default arrow if adding custom one */
    /* background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5%22%20fill%3D%22none%22%20stroke%3D%22%23888%22%20stroke-width%3D%221.5%22%2F%3E%3C%2Fsvg%3E'); */
    /* background-repeat: no-repeat; */
    /* background-position: right 8px center; */
    /* background-size: 12px 12px; */
    padding-right: 30px; /* Make space for default arrow */
}

/* Styles for number input (mostly inherited, can override if needed) */
.resource-filters input[type="number"] {
    /* Example: Hide spinners in WebKit/Blink (Chrome, Safari, Edge) */
    /* -webkit-appearance: textfield; */
    /* appearance: textfield; */ /* Standard way (less supported) */
    /* Example: Hide spinners in Firefox */
    /* -moz-appearance: textfield; */
}

/* Placeholder styling */
.resource-filters input[type="text"]::placeholder,
.resource-filters input[type="number"]::placeholder {
    color: #a0a5aa; /* Lighter placeholder */
    font-size: 13px;
    opacity: 1; /* Ensure placeholder is visible */
}

/* Combined focus styles */
.resource-filters input[type="text"]:focus,
.resource-filters input[type="number"]:focus,
.resource-filters select:focus {
    border-color: #007cba; /* WP focus blue */
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}


/* Secondary Button Styling (Clear Filters) */
.resource-filters .filter-actions {
    justify-content: flex-end;
    align-items: flex-end;
}
#clear-filters {
    background-color: #f7f7f7;
    border: 1px solid #ccc;
    color: #555;
    border-radius: 3px;
    padding: 7px 12px; /* Slightly smaller */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
#clear-filters:hover,
#clear-filters:focus {
    background-color: #f0f0f0;
    border-color: #999;
    color: #333;
    outline: none;
}


/* Update these styles */
.drip-core-page .resource-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background-color: #fdfdfd;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.5rem;
}

.drip-core-page .resource-filters-header.expanded {
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.drip-core-page .resource-filters-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.drip-core-page .resource-filters-header .toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drip-core-page .resource-filters-header .toggle-icon::before {
    content: "▼"; /* dashicons-arrow-down */
    display: block;
    font: normal 20px/1 dashicons;
    color: #50575e;
}

.drip-core-page .resource-filters-header.expanded .toggle-icon::before {
    content: "▲"; /* dashicons-arrow-up */
}

/* Dashicons-specific styles - will only apply if Dashicons is loaded */
.wp-admin .resource-filters-header .toggle-icon::before {
    content: "\f347"; /* dashicons-arrow-down-alt2 */
    font-family: dashicons;
    font-size: 16px;
    line-height: 1;
}

.wp-admin .resource-filters-header.expanded .toggle-icon::before {
    content: "\f343"; /* dashicons-arrow-up-alt2 */
}


.drip-core-page .resource-filters {
    /* Update existing .resource-filters styles */
    border-top: none;
    border-radius: 0 0 4px 4px;
    transition: max-height 0.3s ease-out, opacity 0.2s ease-out, padding 0.3s ease-out;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0;
    border: none;
    margin: 0;
}

.drip-core-page .resource-filters.expanded {
    max-height: 1000px; /* Adjust this value based on your content */
    opacity: 1;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    margin-bottom: 2.5rem;
}

/* Add this at the end of your existing drip-core.css file */

/* --- Settings Page Styles --- */
.drip-core-settings-page .form-table th {
    width: 200px; /* Give labels a fixed width for alignment */
}

.drip-core-settings-page .small-text {
    width: 80px; /* Make the number input a reasonable size */
}
