/**
 * Admin styles for Recognyze Client plugin
 */

/* Admin Header */
.wprc-admin-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wprc-header-content {
    width: 100%;
}

.wprc-header-content h1 {
    margin-top: 0;
    margin-bottom: 10px;
}

.wprc-nav {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.wprc-nav a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    background: #f6f7f7;
    color: #2c3338;
    border: 1px solid #dcdcde;
    transition: all 0.2s ease;
}

.wprc-nav a:hover {
    background: #f0f0f1;
}

.wprc-nav a.button-primary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.wprc-nav a.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.wprc-nav-icon {
    margin-right: 5px;
}

.wprc-nav-button {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.4;
}

.wprc-nav-button:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #999;
}

.wprc-nav-button:disabled,
.wprc-nav-button.wprc-nav-button-disabled {
    background: #f9f9f9;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
    opacity: 0.6;
}

/* Cards */
.wprc-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

.wprc-card h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Action buttons and details */
.wprc-action-buttons {
    white-space: nowrap;
}

.wprc-details {
    display: none;
    padding: 10px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.wprc-details.show {
    display: block;
}

/* Quick stats */
.wprc-quickstats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.wprc-stat-card {
    background: #fff;
    flex: 1;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.wprc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wprc-stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2271b1;
}

.wprc-stat-label {
    color: #666;
    font-size: 14px;
}

.wprc-response-details {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-top: 10px;
    max-width: 100%;
    overflow: hidden;
}

.wprc-response-details pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
}

/* Status indicators */
.wprc-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
}

.wprc-status-submitted {
    background: #edfaef;
    color: #46b450;
}

.wprc-status-not-submitted {
    background: #f1f1f1;
    color: #666;
}

.wprc-status-conflict {
    background: #fce8e8;
    color: #d63638;
}

.wprc-toggle-details {
    cursor: pointer;
    color: #2271b1;
    font-size: 12px;
}

/* Table adjustments */
.wp-list-table .column-status {
    width: 120px;
}

.wp-list-table .column-submission_date {
    width: 150px;
}

/* Sortable column styles */
.wp-list-table th.column-submission_date.sortable a,
.wp-list-table th.column-submission_date.sorted a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.wp-list-table th.column-submission_date.sortable a:hover,
.wp-list-table th.column-submission_date.sorted a:hover {
    color: #2271b1;
}

.wp-list-table th.column-submission_date .sorting-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    opacity: 0.3;
}

.wp-list-table th.column-submission_date.sortable .sorting-indicator {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #666;
    border-top: 0;
}

.wp-list-table th.column-submission_date.sorted .sorting-indicator {
    opacity: 1;
}

.wp-list-table th.column-submission_date.sorted.asc .sorting-indicator {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #2271b1;
    border-bottom: 0;
}

.wp-list-table th.column-submission_date.sorted.desc .sorting-indicator {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #2271b1;
    border-top: 0;
}

.wp-list-table .column-price {
    width: 100px;
}

.wp-list-table .column-actions {
    width: 180px;
}

.wp-list-table input[type="number"] {
    width: 80px;
}

/* Table styles */
.wp-list-table .check-column {
    width: 2.2em;
}

.wp-list-table .column-cb input {
    margin-left: 8px;
    vertical-align: text-top;
}

/* Bulk actions */
.tablenav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 15px;
    height: auto;
    min-height: 30px;
    width: 100%;
    clear: both;
}

.tablenav .actions {
    display: inline-flex;
    align-items: center;
    padding: 0 8px 0 0;
    margin-right: 8px;
}

.tablenav .bulkactions {
    display: inline-flex;
    align-items: center;
}

.bulkactions select {
    margin-right: 6px;
    max-width: 200px;
}

.tablenav .actions select {
    margin-right: 6px;
    max-width: 12.5rem;
}

/* Fix for alignment in top tablenav */
.tablenav.top {
    margin-top: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.tablenav.top .alignleft {
    margin-right: 15px;
}

.tablenav.top .tablenav-pages {
    margin-left: auto;
}

.tablenav-pages {
    display: inline-flex;
    align-items: center;
}

.tablenav-pages .pagination-links {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tablenav-pages .displaying-num {
    margin-right: 10px;
}

.tablenav-pages .paging-input {
    margin: 0 5px;
    display: inline-flex;
    align-items: center;
}

.tablenav-pages .tablenav-paging-text {
    margin-left: 5px;
}

.tablenav.bottom {
    margin-bottom: 0;
}

/* Improve button alignment */
.tablenav .button,
.tablenav .action {
    vertical-align: middle;
}

/* Additional polish */
.button-small {
    transition: all 0.2s ease;
}

.button-small:hover {
    transform: translateY(-1px);
}





/* Table row hover */
.wp-list-table tr:hover td {
    background-color: #f7f7f7;
}

/* Button styling */
.delete-button {
    color: #b32d2e;
    border-color: #b32d2e;
}

.delete-button:hover {
    background: #b32d2e;
    color: #fff;
}

/* Items per page filter */
.tablenav .filter-items-wrap {    display: inline-flex;    align-items: center;    margin-right: 10px; /* Add margin to create space between components */}

#filter-by-items-per-page {
    min-width: 80px;
}

#post-query-submit {
    margin-left: 5px;
}

/* Access logs table styling improvements */
.wp-list-table.wprc-access-logs-table {
    position: relative;
    overflow-x: auto;
}

/* Sticky header */
.wp-list-table.wprc-access-logs-table thead th {
    position: sticky;
    top: 32px; /* Account for WordPress admin bar */
    background: #f1f1f1;
    border-bottom: 2px solid #ddd;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Zebra striping */
.wp-list-table.wprc-access-logs-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-list-table.wprc-access-logs-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Hover effects */
.wp-list-table.wprc-access-logs-table tbody tr:hover {
    background-color: #f0f8ff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Column widths and alignment */
.wp-list-table.wprc-access-logs-table th,
.wp-list-table.wprc-access-logs-table td {
    vertical-align: top;
    padding: 8px 10px;
}

.wp-list-table.wprc-access-logs-table .column-timestamp {
    width: 120px;
    min-width: 120px;
}

.wp-list-table.wprc-access-logs-table .column-user_type {
    width: 90px;
    min-width: 90px;
    text-align: center;
}

.wp-list-table.wprc-access-logs-table .column-ip_address {
    width: 120px;
    min-width: 120px;
    font-family: monospace;
    font-size: 13px;
}

.wp-list-table.wprc-access-logs-table .column-post_title {
    width: auto;
    min-width: 200px;
    max-width: 300px;
}

.wp-list-table.wprc-access-logs-table .column-post_id {
    width: 80px;
    min-width: 80px;
    text-align: center;
    font-family: monospace;
}

.wp-list-table.wprc-access-logs-table .column-time_ago {
    width: 100px;
    min-width: 100px;
    font-size: 12px;
    color: #666;
}

.wp-list-table.wprc-access-logs-table .column-request_uri {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.wp-list-table.wprc-access-logs-table .column-user_agent {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

/* URI/Path column styling */
.wp-list-table.wprc-access-logs-table .column-request_uri .wprc-uri {
    word-break: break-all;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}

.wp-list-table.wprc-access-logs-table .column-request_uri .wprc-uri small {
    color: #666;
    font-size: 10px;
    display: block;
    margin-top: 2px;
}

/* User type badges */
.wp-list-table.wprc-access-logs-table .wprc-ai-crawler {
    background: #e8f4f8;
    color: #0073aa;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
}

.wp-list-table.wprc-access-logs-table .wprc-human-traffic {
    background: #f0f6ff;
    color: #0073aa;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
}

/* Post title truncation */
.wp-list-table.wprc-access-logs-table .column-post_title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-list-table.wprc-access-logs-table .column-post_title a {
    color: #0073aa;
    text-decoration: none;
}

.wp-list-table.wprc-access-logs-table .column-post_title a:hover {
    text-decoration: underline;
}

/* User agent truncation */
.wp-list-table.wprc-access-logs-table .column-user_agent {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: #666;
}

/* Deleted post styling */
.wp-list-table.wprc-access-logs-table .wprc-deleted-post {
    color: #a00;
    font-style: italic;
}

/* ========================================
   UNSIGNED ACCESS LOGS DASHBOARD STYLES
   ======================================== */

/* Dashboard Section */
.wprc-dashboard-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    padding: 25px;
}

.wprc-dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #1d2327;
    font-size: 24px;
}

.wprc-dashboard-section .description {
    color: #646970;
    margin-bottom: 25px;
    font-size: 14px;
}

/* Metrics Grid */
.wprc-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wprc-metric-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wprc-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2271b1, #72aee6);
}

.wprc-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #2271b1;
}

.wprc-metric-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #646970;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wprc-metric-value {
    font-size: 36px;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: 8px;
    line-height: 1;
}

.wprc-metric-value.wprc-highlight {
    color: #d63638;
}

.wprc-metric-value.wprc-ai-highlight {
    color: #00a32a;
}

.wprc-metric-card p {
    margin: 0;
    font-size: 12px;
    color: #646970;
    font-weight: 500;
}

/* Dashboard Widgets */
.wprc-dashboard-widget {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.wprc-dashboard-widget h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1d2327;
    border-bottom: 2px solid #e2e4e7;
    padding-bottom: 10px;
}

/* Bot Types List */
.wprc-bot-types-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wprc-bot-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #2271b1;
    transition: all 0.2s ease;
}

.wprc-bot-type-item:hover {
    background: #f0f6ff;
    transform: translateX(3px);
}

.wprc-bot-name {
    font-weight: 600;
    color: #1d2327;
}

.wprc-bot-count {
    background: #2271b1;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Top Posts List */
.wprc-top-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wprc-post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e2e4e7;
    transition: all 0.2s ease;
}

.wprc-post-item:hover {
    background: #f0f6ff;
    border-color: #2271b1;
    transform: translateX(3px);
}

.wprc-post-info {
    flex: 1;
}

.wprc-post-info strong {
    display: block;
    color: #1d2327;
    margin-bottom: 3px;
}

.wprc-post-info small {
    color: #646970;
    font-size: 11px;
}

.wprc-post-visits {
    background: #d63638;
    color: #fff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Activity Chart */
.wprc-activity-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.wprc-day-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.wprc-bar-label {
    width: 50px;
    font-size: 12px;
    font-weight: 600;
    color: #646970;
    text-align: right;
}

.wprc-bar-container {
    flex: 1;
    height: 20px;
    background: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    position: relative;
}

.wprc-bar-human {
    background: #72aee6;
    height: 100%;
    transition: width 0.3s ease;
}

.wprc-bar-bot {
    background: #d63638;
    height: 100%;
    transition: width 0.3s ease;
}

.wprc-bar-total {
    width: 60px;
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    text-align: right;
}

.wprc-chart-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.wprc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #646970;
}

.wprc-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.wprc-legend-color.wprc-human {
    background: #72aee6;
}

.wprc-legend-color.wprc-bot {
    background: #d63638;
}

/* Logs Section */
.wprc-logs-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
}

.wprc-logs-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1d2327;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wprc-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wprc-metric-card {
        padding: 15px;
    }
    
    .wprc-metric-value {
        font-size: 28px;
    }
    
    .wprc-dashboard-widget {
        padding: 15px;
    }
    
    .wprc-day-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .wprc-bar-label {
        width: auto;
        text-align: left;
    }
    
    .wprc-bar-total {
        width: auto;
        text-align: left;
    }
}



