/**
 * Request Flow Pro - Premium Admin Styles (Minimal & serious)
 * Primary Color: Deep Violet (#6200EA)
 * Design System: Flat, Rounded, No Shadows, No Gradients
 */

:root {
    --rfp-primary: #6200EA;
    --rfp-primary-hover: #5000BF;
    --rfp-secondary: #F3F4F6;
    --rfp-text-main: #111827;
    --rfp-text-sub: #6B7280;
    --rfp-border: #E5E7EB;
    --rfp-bg-card: #FFFFFF;
    --rfp-bg-body: #F9FAFB;
    --rfp-success: #10B981;
    --rfp-pending: #F59E0B;
    --rfp-error: #EF4444;
    --rfp-radius: 12px;
    --rfp-radius-sm: 8px;
    --rfp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Base Layout Overrides */
.wrap.approval-plugin-wrap {
    margin: 20px 20px 0 0;
    font-family: var(--rfp-font);
    color: var(--rfp-text-main);
    max-width: 100%;
    /* Full width as requested */
    width: auto;
}

/* Notifications */
.approval-plugin-wrap .notice {
    border-left: none;
    border-radius: var(--rfp-radius-sm);
    box-shadow: none;
    border: 1px solid var(--rfp-border);
    margin: 20px 0;
    padding: 12px 16px;
    background: var(--rfp-bg-card);
}

.approval-plugin-wrap .notice-success {
    border-left: 4px solid var(--rfp-success);
}

.approval-plugin-wrap .notice-error {
    border-left: 4px solid var(--rfp-error);
}

/* Header Section */
.approval-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--rfp-border);
}

.approval-main-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--rfp-text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.approval-main-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--rfp-primary);
}

.page-subtitle {
    margin: 4px 0 0 40px;
    color: var(--rfp-text-sub);
    font-size: 14px;
}

/* Action Buttons */
.approval-plugin-wrap .button {
    border-radius: 50px !important;
    border: 1px solid transparent !important;
    padding: 6px 20px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    text-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
}

.approval-plugin-wrap .button-primary {
    background: var(--rfp-primary) !important;
    color: #fff !important;
}

.approval-plugin-wrap .button-primary:hover,
.approval-plugin-wrap .button-primary:focus {
    background: var(--rfp-primary-hover) !important;
    transform: translateY(-1px);
}

.approval-plugin-wrap .button-secondary {
    background: white !important;
    border: 1px solid var(--rfp-border) !important;
    color: var(--rfp-text-main) !important;
}

.approval-plugin-wrap .button-secondary:hover {
    border-color: var(--rfp-text-sub) !important;
    color: var(--rfp-primary) !important;
    background: var(--rfp-bg-body) !important;
}

/* Stats Dashboard */
.approval-stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.approval-stat-card {
    background: var(--rfp-bg-card);
    border-radius: var(--rfp-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--rfp-border);
    transition: transform 0.2s ease;
}

.approval-stat-card:hover {
    border-color: var(--rfp-primary);
    transform: translateY(-2px);
}

.stat-icon {
    margin-bottom: 16px;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Specific Card Colors */
.total-circle {
    background: #EDE7F6;
    color: var(--rfp-primary);
}

.pending-circle {
    background: #FFF8E1;
    color: var(--rfp-pending);
}

.approved-circle {
    background: #E8F5E9;
    color: var(--rfp-success);
}

.rejected-circle {
    background: #FFEBEE;
    color: var(--rfp-error);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--rfp-text-main);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--rfp-text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Section */
.approval-filters-wrapper {
    background: var(--rfp-bg-card);
    border-radius: var(--rfp-radius);
    padding: 16px 24px;
    border: 1px solid var(--rfp-border);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.approval-filters-section {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--rfp-text-sub);
    transition: all 0.2s;
    background: transparent;
}

.filter-tab:hover {
    color: var(--rfp-primary);
    background: var(--rfp-bg-body);
}

.filter-tab.active {
    background: var(--rfp-primary);
    color: white;
}

/* Search Box */
.approval-search-box {
    border: 1px solid var(--rfp-border) !important;
    border-radius: 50px !important;
    padding: 8px 16px 8px 40px !important;
    width: 280px !important;
    background: var(--rfp-bg-body) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%239CA3AF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat 12px center !important;
    transition: width 0.3s ease;
}

.approval-search-box:focus {
    width: 320px !important;
    border-color: var(--rfp-primary) !important;
    background-color: white !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Table Actions */
.tablenav.top {
    margin-bottom: 16px;
}

.tablenav .actions select {
    border: 1px solid var(--rfp-border) !important;
    border-radius: var(--rfp-radius-sm) !important;
    padding: 4px 32px 4px 12px !important;
    height: 36px !important;
    vertical-align: middle;
}

/* Users Table */
.wp-list-table.users-table {
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.wp-list-table.users-table thead th,
.wp-list-table.users-table thead td {
    border-bottom: 2px solid var(--rfp-border);
    font-weight: 600;
    color: var(--rfp-text-sub);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    padding: 16px;
    background: transparent !important;
}

.wp-list-table.users-table tbody tr {
    background: var(--rfp-bg-card);
    transition: background 0.2s;
}

.wp-list-table.users-table tbody tr:hover {
    background: var(--rfp-bg-body);
}

.wp-list-table.users-table tbody td,
.wp-list-table.users-table tbody th {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--rfp-border);
    color: var(--rfp-text-main);
    font-size: 14px;
    box-shadow: none !important;
}

.wp-list-table.users-table tbody tr td:first-child,
.wp-list-table.users-table tbody tr th:first-child {
    border-top-left-radius: var(--rfp-radius-sm);
    border-bottom-left-radius: var(--rfp-radius-sm);
    border-left: 1px solid var(--rfp-border);
    border-top: 1px solid var(--rfp-border);
    border-bottom: 1px solid var(--rfp-border);
}

.wp-list-table.users-table tbody tr td:last-child {
    border-top-right-radius: var(--rfp-radius-sm);
    border-bottom-right-radius: var(--rfp-radius-sm);
    border-right: 1px solid var(--rfp-border);
    border-top: 1px solid var(--rfp-border);
    border-bottom: 1px solid var(--rfp-border);
}

.wp-list-table.users-table tbody tr td:not(:first-child):not(:last-child) {
    border-top: 1px solid var(--rfp-border);
    border-bottom: 1px solid var(--rfp-border);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-approved {
    background: #E8F5E9;
    color: var(--rfp-success);
}

.status-pending {
    background: #FFF8E1;
    color: var(--rfp-pending);
}

.status-rejected {
    background: #FFEBEE;
    color: var(--rfp-error);
}

/* Action Buttons */
.button.user-quick-approve {
    background: white !important;
    border: 1px solid var(--rfp-success) !important;
    color: var(--rfp-success) !important;
}

.button.user-quick-approve:hover {
    background: var(--rfp-success) !important;
    color: white !important;
}

.button.user-quick-deny {
    background: white !important;
    border: 1px solid var(--rfp-error) !important;
    color: var(--rfp-error) !important;
}

.button.user-quick-deny:hover {
    background: var(--rfp-error) !important;
    color: white !important;
}

/* Settings Form */
.form-table th {
    font-weight: 600;
    color: var(--rfp-text-main);
}

.regular-text,
.large-text,
textarea {
    border: 1px solid var(--rfp-border) !important;
    border-radius: var(--rfp-radius-sm) !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
    background: var(--rfp-bg-body) !important;
    transition: all 0.2s;
}

.regular-text:focus,
.large-text:focus,
textarea:focus {
    border-color: var(--rfp-primary) !important;
    background: white !important;
    outline: none !important;
}

input[type=checkbox] {
    border-radius: 4px !important;
    border: 1px solid #9CA3AF !important;
    /* Higher contrast border (Gray 400) */
    height: 18px !important;
    width: 18px !important;
    background: white !important;
    box-shadow: none !important;
    margin-right: 8px !important;
}

input[type=checkbox]:checked {
    background: var(--rfp-primary) url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E") no-repeat center center !important;
    border-color: var(--rfp-primary) !important;
    background-size: 16px 16px !important;
}

/* Hide default WP checkmark to prevent double ticks */
input[type=checkbox]:checked::before {
    display: none !important;
    content: "" !important;
}

input[type=checkbox]:focus {
    border-color: var(--rfp-primary) !important;
    box-shadow: 0 0 0 2px rgba(98, 0, 234, 0.1) !important;
    outline: none !important;
}

@media screen and (max-width: 782px) {
    .approval-stats-dashboard {
        grid-template-columns: 1fr;
    }

    .approval-filters-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* =========================================
   Settings Page Styles
   ========================================= */

/* Settings Tabs (Pill Design) */
.approval-settings-tabs .nav-tab-wrapper {
    border-bottom: none !important;
    display: flex;
    gap: 8px;
    padding-bottom: 0 !important;
    margin-bottom: 24px !important;
}

.approval-settings-tabs .nav-tab {
    border: 1px solid var(--rfp-border) !important;
    background: white !important;
    /* White background for better contrast */
    color: #4B5563 !important;
    /* Darker gray text (Gray 600) */
    border-radius: 50px !important;
    margin: 0 !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    /* Slightly bolder */
    font-size: 14px !important;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.approval-settings-tabs .nav-tab:hover {
    border-color: var(--rfp-primary) !important;
    color: var(--rfp-primary) !important;
    background: #F3F4F6 !important;
    /* Gray 100 on hover */
}

.approval-settings-tabs .nav-tab.nav-tab-active {
    background: var(--rfp-primary) !important;
    color: white !important;
    border-color: var(--rfp-primary) !important;
}

/* Tab Content Logic */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Settings Sections (Card Style) */
.settings-section {
    background: var(--rfp-bg-card);
    border: 1px solid var(--rfp-border);
    border-radius: var(--rfp-radius);
    padding: 32px;
}

.settings-section h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--rfp-border);
    padding-bottom: 16px;
    color: var(--rfp-text-main);
}

.settings-section h3 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--rfp-text-main);
}

/* Toggle Switch (iOS style) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    vertical-align: middle;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E5E7EB;
    transition: .3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:checked+.toggle-slider {
    background-color: var(--rfp-primary);
}

input:focus+.toggle-slider {
    box-shadow: 0 0 0 2px rgba(98, 0, 234, 0.2);
}

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