/**
 * Prime SEO Redirects Page Styles
 *
 * Redirects and 404 Monitor styles.
 *
 * @package Prime_SEO
 * @since 3.8.1
 */

/* Tabs */
.rw-tabs {
    display: flex;
    background: #fff;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    overflow: hidden;
}

.rw-tabs a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.rw-tabs a:hover {
    color: #6366f1;
    background: #f8fafc;
}

.rw-tabs a.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

.rw-tabs .count {
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.rw-tabs a.active .count {
    background: #eef2ff;
    color: #6366f1;
}

/* Body */
.rw-body {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 24px;
}

/* Add Form */
.rw-add {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.rw-add h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #6366f1;
    margin: 0 0 20px;
}

.rw-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.rw-fg {
    flex: 1;
    min-width: 200px;
}

.rw-fg.sm {
    flex: 0 0 140px;
    min-width: 140px;
}

.rw-fg.btn {
    flex: 0 0 auto;
}

.rw-fg label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.rw-fg input,
.rw-fg select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.rw-fg input:focus,
.rw-fg select:focus {
    outline: none;
    border-color: #6366f1;
}

/* Prefix Input */
.rw-prefix {
    display: flex;
}

.rw-prefix span {
    background: #e2e8f0;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.rw-prefix input {
    border-radius: 0 8px 8px 0;
}

/* Buttons - Full reset + Override WordPress defaults */
.prime-wrap .rw-btn,
.prime-wrap button.rw-btn,
.prime-wrap button[type="submit"].rw-btn,
.rw-add .rw-btn,
.rw-form .rw-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 12px 24px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    background-image: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    background-color: transparent !important;
    border: none !important;
    border-width: 0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
    vertical-align: middle !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: all 0.2s ease !important;
    position: relative !important;
    z-index: 10 !important;
    overflow: visible !important;
}

/* Reset parent wrapper */
.rw-fg.btn {
    position: relative !important;
    z-index: 1 !important;
    background: transparent !important;
}

/* Remove any pseudo-elements */
.prime-wrap .rw-btn::before,
.prime-wrap .rw-btn::after,
.rw-add .rw-btn::before,
.rw-add .rw-btn::after {
    display: none !important;
    content: none !important;
}

.prime-wrap .rw-btn:hover,
.prime-wrap button.rw-btn:hover,
.prime-wrap button[type="submit"].rw-btn:hover,
.rw-add .rw-btn:hover,
.rw-form .rw-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    background-image: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
    border: none !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.prime-wrap .rw-btn:focus,
.prime-wrap button.rw-btn:focus,
.prime-wrap button[type="submit"].rw-btn:focus,
.rw-add .rw-btn:focus,
.rw-form .rw-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
}

.prime-wrap .rw-btn:active,
.rw-add .rw-btn:active {
    transform: translateY(0) !important;
}

/* Header */
.rw-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.rw-hdr h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Filters */
.rw-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rw-filter {
    font-size: 13px;
    color: #64748b;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f1f5f9;
}

.rw-filter:hover {
    background: #e2e8f0;
}

.rw-filter.cur {
    background: #6366f1;
    color: #fff;
}

/* Table */
.rw-tbl {
    width: 100%;
    border-collapse: collapse;
}

.rw-tbl th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

.rw-tbl td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

.rw-tbl tr:hover td {
    background: #f8fafc;
}

.rw-tbl tr.off td {
    opacity: 0.5;
}

.rw-tbl code {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    color: #6366f1;
}

.rw-tbl a {
    color: #6366f1;
    text-decoration: none;
}

/* Badges */
.rw-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.rw-b301 {
    background: #d1fae5;
    color: #065f46;
}

.rw-b302,
.rw-b307 {
    background: #fef3c7;
    color: #92400e;
}

.rw-b410 {
    background: #fee2e2;
    color: #991b1b;
}

.rw-b451 {
    background: #fce7f3;
    color: #9d174d;
}

.rw-bon {
    background: #d1fae5;
    color: #065f46;
}

.rw-boff {
    background: #fee2e2;
    color: #991b1b;
}

/* Actions */
.rw-acts {
    display: flex;
    gap: 8px;
}

.rw-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    text-decoration: none;
}

.rw-act:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.rw-act.del:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fee2e2;
}

.rw-act .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Empty State */
.rw-empty {
    text-align: center;
    padding: 60px 20px;
}

.rw-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.rw-empty p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

/* 404 Filter */
.rw-404f {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rw-404f input {
    width: 180px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.rw-404f button {
    padding: 8px 16px;
    background: #6366f1;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

/* Bulk Actions */
.rw-bulk {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rw-bulk select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    min-width: 160px;
}

.rw-bulk button {
    padding: 8px 16px;
    background: #6366f1;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
}

.rw-bulk button:hover {
    background: #4f46e5;
}

.rw-bulk button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.rw-bulk-info {
    font-size: 13px;
    color: #64748b;
    margin-left: auto;
}

.rw-tbl th.rw-cb,
.rw-tbl td.rw-cb {
    width: 40px;
    text-align: center;
}

.rw-tbl input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #6366f1;
}

/* Regex Badge */
.rw-regex {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-family: monospace;
}

.rw-tbl code.rw-regex-code {
    background: #fef3c7;
    color: #92400e;
}

/* Help Card */
.rw-help-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-top: 20px;
    overflow: hidden;
}

.rw-help-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border-bottom: 1px solid #c7d2fe;
}

.rw-help-header .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #6366f1;
}

.rw-help-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
    margin: 0;
}

.rw-help-body {
    padding: 20px;
}

.rw-help-section {
    margin-bottom: 20px;
}

.rw-help-section:last-of-type {
    margin-bottom: 16px;
}

.rw-help-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
}

.rw-help-section ol,
.rw-help-section ul {
    margin: 0;
    padding-left: 20px;
}

.rw-help-section li {
    font-size: 12px;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.5;
}

.rw-help-section p {
    font-size: 12px;
    color: #475569;
    margin: 0;
    line-height: 1.5;
}

.rw-help-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 8px;
    border: 1px solid #fde68a;
}

.rw-help-tip .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}

.rw-help-tip span:last-child {
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* Module Toggle Card */
.rw-module-toggle {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.rw-module-toggle-text h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px;
}

.rw-module-toggle-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.rw-module-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

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

.rw-module-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 28px;
    transition: 0.3s;
}

.rw-module-switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rw-module-switch input:checked + .rw-module-switch-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

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

.rw-module-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 404 Settings Card */
.rw-settings-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.rw-settings-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rw-settings-card h4 .dashicons {
    color: #f59e0b;
}

/* Toggle Row */
.rw-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.rw-toggle-row:last-child {
    margin-bottom: 0;
}

.rw-toggle-text h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px;
}

.rw-toggle-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.rw-toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.rw-toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: 0.3s;
}

.rw-toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rw-toggle-switch input:checked + .rw-toggle-switch-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

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

/* Fallback Options */
.rw-fallback-options {
    margin-top: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.rw-fallback-options.hidden {
    display: none;
}

.rw-fallback-field {
    margin-bottom: 12px;
}

.rw-fallback-field:last-child {
    margin-bottom: 0;
}

.rw-fallback-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.rw-fallback-field select,
.rw-fallback-field input {
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.rw-fallback-field select:focus,
.rw-fallback-field input:focus {
    outline: none;
    border-color: #6366f1;
}

.rw-fallback-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 12px;
    color: #92400e;
}

.rw-fallback-note .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Save Button */
.rw-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

.rw-save-btn:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.rw-save-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Spin Animation */
.spin {
    animation: rw-spin 1s linear infinite;
}

@keyframes rw-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .rw-form {
        flex-direction: column;
    }

    .rw-fg,
    .rw-fg.sm {
        min-width: 100%;
        flex: 1 1 100%;
    }
}
