/* ===================== E Toolbox - Admin Styles ===================== */

.e-toolbox-wrap {
    margin: 20px 20px 20px 2px;
    max-width: 1600px;
    background: #fff;
    border: 1px solid #e1e1e1;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}
.e-toolbox-wrap h1 { display: none; }

/* Banner */
.e-toolbox-banner {
    background: linear-gradient(135deg, #2b65ec 0%, #4a88f7 100%);
    color: white;
    padding: 40px 40px;
    margin: -20px -20px 20px -20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(43, 101, 236, 0.3);
    border-radius: 16px 16px 0 0;
}
.e-toolbox-banner h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
}
.e-toolbox-banner p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}
.e-toolbox-banner::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

/* Layout */
.e-toolbox-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.e-toolbox-main {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e1e1;
    overflow: hidden;
}

/* Tabs */
.e-toolbox-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}
.e-toolbox-tab-btn {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    display: block;
    outline: none;
    box-shadow: none;
}
.e-toolbox-tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.e-toolbox-tab-btn:focus,
.e-toolbox-tab-btn:active {
    outline: none;
    box-shadow: none;
}
.e-toolbox-tab-btn.active {
    background: #fff;
    color: #2b65ec;
    border-bottom-color: #2b65ec;
    font-weight: bold;
}

/* Tab Content */
.e-toolbox-tab-content {
    padding: 30px;
}
.e-toolbox-tab-pane {
    display: none;
}
.e-toolbox-tab-pane.active {
    display: block;
    animation: e-toolbox-fade-in 0.25s ease;
}
@keyframes e-toolbox-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Section Title */
.e-toolbox-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.e-toolbox-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #2b65ec;
    margin-right: 10px;
    border-radius: 2px;
}

/* Post Type Row */
.e-toolbox-post-type-row {
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
}
.e-toolbox-post-type-row:last-child {
    border-bottom: none;
}
.e-toolbox-pt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.e-toolbox-pt-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}
.e-toolbox-pt-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Advanced Settings */
.e-toolbox-advanced-settings {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
}
.e-toolbox-setting-group {
    margin-bottom: 15px;
}
.e-toolbox-setting-group:last-child {
    margin-bottom: 0;
}
.e-toolbox-setting-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}
.e-toolbox-setting-group input[type="text"],
.e-toolbox-setting-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

/* Validation */
.e-toolbox-input-error {
    border-color: #ff3b30 !important;
    box-shadow: 0 0 0 1px #ff3b30 !important;
}
.e-toolbox-error-msg {
    color: #ff3b30;
    font-size: 12px;
    margin-top: 4px;
}
.e-toolbox-setting-group textarea {
    resize: vertical;
    min-height: 60px;
}
.e-toolbox-setting-inline {
    display: flex;
    gap: 15px;
}
.e-toolbox-setting-inline .e-toolbox-setting-group {
    flex: 1;
}

/* Toggle Switch */
.e-toolbox-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.e-toolbox-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.e-toolbox-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.e-toolbox-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .e-toolbox-slider {
    background-color: #2b65ec;
}
input:focus + .e-toolbox-slider {
    box-shadow: 0 0 1px #2b65ec;
}
input:checked + .e-toolbox-slider:before {
    transform: translateX(20px);
}

/* Submit Box */
.e-toolbox-submit-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: left;
}
.button-primary {
    background: #2b65ec;
    border-color: #2b65ec;
    color: #fff;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    height: auto;
    outline: none;
    box-shadow: none;
}
.button-primary:hover {
    background: #1e52d6;
    border-color: #1e52d6;
}
.button-primary:focus,
.button-primary:active {
    outline: none;
    box-shadow: none;
}

/* Sidebar */
.e-toolbox-sidebar {
    width: 380px;
    flex-shrink: 0;
}
.e-toolbox-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e1e1e1;
}
.e-toolbox-card h3 {
    margin: 0 0 15px 0;
    font-size: 15px;
    color: #2b65ec;
    display: flex;
    align-items: center;
}
.e-toolbox-card h3 span.dashicons {
    margin-right: 8px;
    font-size: 18px;
}
.e-toolbox-card p,
.e-toolbox-card li {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}
.e-toolbox-card ol {
    padding-left: 20px;
    margin: 0;
}

/* Progress Bar */
.e-toolbox-progress-bar {
    width: 100%;
    height: 25px;
    background: #f1f1f1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
}
.e-toolbox-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ===================== iOS Glassmorphism Toast ===================== */
@keyframes e-toolbox-toast-in {
    0% { opacity: 0; transform: translateX(40px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes e-toolbox-toast-out {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(40px); }
}

.e-toolbox-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(30px) saturate(1.4);
    -webkit-backdrop-filter: blur(30px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    color: #1c1c1e;
    pointer-events: none;
    animation: e-toolbox-toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.e-toolbox-toast.e-toolbox-toast-hide {
    animation: e-toolbox-toast-out 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.e-toolbox-toast .e-toolbox-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.e-toolbox-toast.e-toolbox-toast-success .e-toolbox-toast-icon {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}
.e-toolbox-toast.e-toolbox-toast-error .e-toolbox-toast-icon {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

/* ===================== Log Table (single-admin-guard style) ===================== */

.e-toolbox-log-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.e-toolbox-log-toolbar-left {
    flex: 1;
}
.e-toolbox-log-toolbar-right {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.e-toolbox-log-toolbar select {
    vertical-align: middle;
}

.e-toolbox-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}
.e-toolbox-table thead th {
    background: #f0f4ff;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e8f5;
    font-weight: 600;
    color: #1a2b4a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.e-toolbox-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
}
.e-toolbox-table tbody tr:last-child td {
    border-bottom: none;
}
.e-toolbox-table tbody tr:hover {
    background: #fafbff;
}
.e-toolbox-table tbody tr td:first-child {
    font-weight: 500;
    color: #333;
}
.e-toolbox-table tbody tr.e-toolbox-row-hidden {
    display: none;
}

/* Log Type Badges */
.e-toolbox-log-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.e-toolbox-log-badge-content_generated { background: #e8f5e9; color: #2e7d32; }
.e-toolbox-log-badge-batch_processed   { background: #e3f2fd; color: #1565c0; }
.e-toolbox-log-badge-api_error         { background: #fbe9e7; color: #c62828; }
.e-toolbox-log-badge-settings_changed  { background: #fff3e0; color: #e65100; }
.e-toolbox-log-badge-system            { background: #f3e5f5; color: #6a1b9a; }

/* Responsive */
@media (max-width: 1000px) {
    .e-toolbox-container {
        flex-direction: column;
    }
    .e-toolbox-sidebar {
        width: 100%;
    }
}
