/* AI Crawler Guard - Modern Admin UI */
:root {
    --acg-blue: #2271b1;
    --acg-red: #d63638;
    --acg-green: #1d7a46;
    --acg-gray: #8c8f94;
    --acg-light-gray: #f6f7f7;
    --acg-border: #dcdcde;
    --acg-text: #1d2327;
    --acg-text-light: #646970;
}

/* Page Header */
.acg-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--acg-border);
}

.acg-page-title {
    font-size: 23px;
    font-weight: 400;
    margin: 0 0 4px;
    padding: 0;
    line-height: 1.3;
}

.acg-page-subtitle {
    color: var(--acg-text-light);
    font-size: 14px;
    margin: 0;
}

.acg-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.acg-docs-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--acg-text);
    text-decoration: none;
    font-size: 14px;
}

.acg-docs-link:hover {
    color: var(--acg-blue);
    transition: color 0.1s ease;
}

.acg-docs-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Tabs Navigation */
.acg-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 24px;
    border-bottom: 2px solid var(--acg-border);
}

.acg-tab {
    display: inline-block;
    padding: 12px 16px;
    color: var(--acg-text-light);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.1s ease;
}

.acg-tab:hover {
    color: var(--acg-text);
    border-bottom-color: var(--acg-border);
}

.acg-tab-active {
    color: var(--acg-blue);
    border-bottom-color: var(--acg-blue);
    font-weight: 600;
}

/* Info Banner */
.acg-info-banner {
    background: var(--acg-light-gray);
    border-left: 4px solid var(--acg-blue);
    padding: 12px 16px;
    margin: 0 0 24px;
    border-radius: 4px;
}

.acg-info-banner p {
    margin: 0;
    color: var(--acg-text);
    font-size: 14px;
}

/* Stat Cards */
.acg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 0 0 24px;
}

.acg-card {
    background: #fff;
    border: 1px solid var(--acg-border);
    border-radius: 6px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.acg-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--acg-blue);
}

.acg-card-blocked::before {
    background: var(--acg-red);
}

.acg-card-allowed::before {
    background: var(--acg-green);
}

.acg-card-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.acg-icon-total {
    background: rgba(34, 113, 177, 0.1);
}

.acg-icon-total .dashicons {
    color: var(--acg-blue);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.acg-icon-blocked {
    background: rgba(214, 54, 56, 0.1);
}

.acg-icon-blocked .dashicons {
    color: var(--acg-red);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.acg-icon-allowed {
    background: rgba(29, 122, 70, 0.1);
}

.acg-icon-allowed .dashicons {
    color: var(--acg-green);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.acg-card-content {
    position: relative;
    z-index: 2;
    padding-right: 60px;
}

.acg-card-label {
    display: block;
    font-size: 14px;
    color: var(--acg-text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

.acg-card-value {
    display: block;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--acg-text);
    margin-bottom: 8px;
}

.acg-card-desc {
    font-size: 13px;
    color: var(--acg-text-light);
    margin: 0;
    line-height: 1.4;
}

/* Mode Card */
.acg-mode-card {
    background: #fff;
    border: 1px solid var(--acg-border);
    border-radius: 6px;
    padding: 20px 24px;
    margin: 0 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.acg-mode-content {
    flex: 1;
}

.acg-mode-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.acg-mode-label {
    font-size: 14px;
    color: var(--acg-text-light);
    font-weight: 500;
}

.acg-mode-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--acg-text);
}

.acg-mode-status .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--acg-red);
}

.acg-mode-note {
    font-size: 13px;
    color: var(--acg-text-light);
    margin: 0;
}

/* Settings Cards */
.acg-settings-card {
    background: #fff;
    border: 1px solid var(--acg-border);
    border-radius: 8px;
    padding: 24px;
    margin: 0 0 24px;
}

.acg-settings-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    padding: 0;
}

.acg-settings-card fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.acg-settings-card label {
    display: block;
    margin-bottom: 16px;
    padding-left: 28px;
    position: relative;
}

.acg-settings-card input[type="radio"],
.acg-settings-card input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 2px;
}

.acg-settings-card .description {
    font-size: 13px;
    color: var(--acg-text-light);
    margin: 4px 0 0 0;
    font-style: normal;
}

.acg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
    margin-bottom: 12px;
}

.acg-checkbox-label input[type="checkbox"] {
    position: static;
    margin: 0;
}

.acg-inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.acg-settings-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--acg-border);
}

.acg-reset-link {
    color: var(--acg-red);
    text-decoration: none;
    font-size: 14px;
}

.acg-reset-link:hover {
    text-decoration: underline;
}

/* Filters */
.acg-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 24px;
    flex-wrap: wrap;
}

.acg-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.acg-filter-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--acg-border);
    border-radius: 20px;
    background: #fff;
    color: var(--acg-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.1s ease;
}

.acg-filter-btn:hover {
    border-color: var(--acg-blue);
    color: var(--acg-blue);
}

.acg-filter-btn.acg-filter-active {
    background: var(--acg-blue);
    border-color: var(--acg-blue);
    color: #fff;
}

.acg-search-form {
    display: flex;
    align-items: center;
}

.acg-search-input {
    min-width: 250px;
    padding: 6px 12px;
    border: 1px solid var(--acg-border);
    border-radius: 4px;
    font-size: 14px;
}

/* Category Badges */
.acg-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acg-category-ai {
    background: rgba(214, 54, 56, 0.1);
    color: var(--acg-red);
}

.acg-category-search {
    background: rgba(34, 113, 177, 0.1);
    color: var(--acg-blue);
}

.acg-category-social {
    background: rgba(140, 143, 148, 0.1);
    color: var(--acg-gray);
}

.acg-category-utility {
    background: rgba(219, 166, 23, 0.1);
    color: #b89500;
}

.acg-category-custom {
    background: var(--acg-light-gray);
    color: var(--acg-text-light);
}

/* Status Badges */
.acg-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.acg-badge.trusted {
    background: rgba(29, 122, 70, 0.15);
    color: var(--acg-green);
}

.acg-badge.blocked {
    background: rgba(214, 54, 56, 0.15);
    color: var(--acg-red);
}

.acg-badge.unknown,
.acg-badge.auto {
    background: var(--acg-light-gray);
    color: var(--acg-text-light);
}

/* Dashboard Grid & Panels */
.acg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 0 0 32px;
}

.acg-panel {
    background: #fff;
    border: 1px solid var(--acg-border);
    border-radius: 6px;
    padding: 24px;
}

.acg-panel h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    padding: 0;
    color: var(--acg-text);
}

/* Trend List */
.acg-trend-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.acg-trend-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.acg-trend-day {
    min-width: 60px;
    color: var(--acg-text-light);
    font-size: 13px;
}

.acg-trend-bar {
    flex: 1;
    height: 24px;
    background: var(--acg-light-gray);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.acg-trend-bar span {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: var(--acg-text);
    z-index: 1;
}

.acg-trend-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--acg-blue);
    opacity: 0.2;
}

/* Status List */
.acg-status-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.acg-status-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--acg-text);
    flex-wrap: wrap;
}

.acg-status-breakdown {
    font-size: 12px;
    color: var(--acg-text-light);
    font-weight: normal;
    margin-left: 4px;
}

.acg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.acg-dot.trusted {
    background: var(--acg-green);
}

.acg-dot.blocked {
    background: var(--acg-red);
}

.acg-dot.unknown,
.acg-dot.auto {
    background: var(--acg-gray);
}

.acg-quick-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.acg-quick-links .button {
    border: 1px solid var(--acg-blue);
    background: #fff;
    color: var(--acg-blue);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.acg-quick-links .button:hover {
    background: var(--acg-blue);
    color: #fff;
}

/* Tables */
.widefat.acg-panel table,
.acg-panel .widefat {
    margin-top: 0;
    border: 0;
}

.acg-panel table thead th {
    background: var(--acg-light-gray);
    font-weight: 600;
    font-size: 13px;
    padding: 10px;
    border-bottom: 1px solid var(--acg-border);
}

.acg-panel table tbody td {
    padding: 12px 10px;
    font-size: 14px;
    border-bottom: 1px solid var(--acg-border);
}

.acg-panel table tbody tr:last-child td {
    border-bottom: 0;
}

/* Action Buttons */
.acg-crawler-actions {
    white-space: nowrap;
    width: auto;
    min-width: 160px;
    max-width: 200px;
}

.acg-actions-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    vertical-align: middle;
}

.acg-warning-icon {
    color: #dba617;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
}

.acg-action-form {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.acg-action-btn.button {
    min-width: 70px;
    font-size: 13px;
    padding: 5px 12px;
    line-height: 1.4;
    height: auto;
    vertical-align: middle;
    margin: 0;
}

.acg-action-btn.button.is-active {
    background-color: var(--acg-blue);
    border-color: var(--acg-blue);
    color: #fff;
    font-weight: 600;
}

.acg-status-help {
    color: var(--acg-text-light);
    font-size: 11px;
    cursor: help;
    margin-left: 4px;
}

/* Custom Rules Table */
.acg-add-rule-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.acg-add-rule-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
}

.acg-custom-rules-table {
    margin-top: 16px;
}

.acg-custom-rules-table input,
.acg-custom-rules-table select {
    width: 100%;
    max-width: 300px;
}

.acg-custom-rules-table .acg-remove-rule {
    color: var(--acg-red);
    text-decoration: none;
}

.acg-custom-rules-table .acg-remove-rule:hover {
    text-decoration: underline;
    transition: text-decoration 0.1s ease;
}

/* Pagination Buttons */
.tablenav .button {
    min-width: 70px;
    text-align: center;
    transition: all 0.1s ease;
}

/* Log Controls */
.acg-log-controls {
    background: #fff;
    border: 1px solid var(--acg-border);
    border-radius: 8px;
    padding: 24px;
    margin: 0 0 24px;
}

.acg-log-controls h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.acg-log-settings {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.acg-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.acg-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.acg-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.acg-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.15s ease;
    border-radius: 24px;
}

.acg-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.15s ease;
    border-radius: 50%;
}

.acg-toggle-switch input:checked + .acg-toggle-slider {
    background-color: var(--acg-blue);
}

.acg-toggle-switch input:checked + .acg-toggle-slider:before {
    transform: translateX(20px);
}

.acg-log-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.acg-log-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.acg-log-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 782px) {
    .acg-page-header {
        flex-direction: column;
        gap: 16px;
    }

    .acg-cards {
        grid-template-columns: 1fr;
    }

    .acg-mode-card {
        flex-direction: column;
    }

    .acg-tabs {
        overflow-x: auto;
    }

    .acg-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .acg-filters select,
    .acg-filters input[type="search"] {
        width: 100%;
    }
}

