/**
 * Blaminhor Essentials Admin Styles
 *
 * @package BlaminhorEssentials
 */

/* Variables */
:root {
    --ap-primary: #2271b1;
    --ap-primary-dark: #135e96;
    --ap-primary-light: #72aee6;
    --ap-success: #00a32a;
    --ap-warning: #dba617;
    --ap-danger: #d63638;
    --ap-gray-50: #f9fafb;
    --ap-gray-100: #f3f4f6;
    --ap-gray-200: #e5e7eb;
    --ap-gray-300: #d1d5db;
    --ap-gray-400: #9ca3af;
    --ap-gray-500: #6b7280;
    --ap-gray-600: #4b5563;
    --ap-gray-700: #374151;
    --ap-gray-800: #1f2937;
    --ap-gray-900: #111827;
    --ap-border-radius: 4px;
    --ap-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    --ap-shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Common Button Styles
   ======================================== */

/* Buttons with icons */
.ap-btn-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-right: 4px;
}

/* When the button uses flex + gap, the gap utility handles spacing,
   so neutralize the icon's margin-right and useless vertical-align. */
.ap-btn-icon.ap-inline-flex-center .dashicons,
.ap-btn-icon.ap-flex-center .dashicons,
.ap-btn-icon.ap-flex-between .dashicons {
    margin-right: 0;
    vertical-align: baseline;
}

.ap-btn-icon.button-hero .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ap-btn-icon.button-small .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Buttons with icon only (no text) */
.ap-btn-icon-only {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 6px !important;
    min-width: 28px;
    height: 28px;
}

.ap-btn-icon-only .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    margin: 0;
}

/* ========================================
   Sortable Tables
   ======================================== */

.ap-sortable-table th.ap-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.ap-sortable-table th.ap-sortable:hover {
    background: #f0f0f1;
}

.ap-sortable-table th.ap-sortable .ap-sort-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
    margin-left: 4px;
    opacity: 0.3;
}

.ap-sortable-table th.ap-sortable .ap-sort-icon::before {
    content: "\f156";
    font-family: dashicons;
    font-size: 16px;
}

.ap-sortable-table th.ap-sortable.asc .ap-sort-icon,
.ap-sortable-table th.ap-sortable.desc .ap-sort-icon {
    opacity: 1;
}

.ap-sortable-table th.ap-sortable.asc .ap-sort-icon::before {
    content: "\f142";
}

.ap-sortable-table th.ap-sortable.desc .ap-sort-icon::before {
    content: "\f140";
}

/* Wrap */
.blaminhor-essentials-wrap {
    max-width: 1200px;
    margin: 20px 20px 20px 0;
}

/* Header */
.blaminhor-essentials-header {
    margin-bottom: 20px;
}

.blaminhor-essentials-header h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px;
    line-height: 1.3;
}

.blaminhor-essentials-logo {
    font-weight: 600;
    color: var(--ap-gray-800);
}

.blaminhor-essentials-logo .separator {
    color: var(--ap-primary);
    padding: 0 1px;
}

.blaminhor-essentials-tagline {
    margin: 4px 0 0;
    color: var(--ap-gray-500);
    font-size: 13px;
}

/* Content */
.blaminhor-essentials-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections - Card style */
.blaminhor-essentials-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    padding: 20px;
    box-shadow: var(--ap-shadow);
}

.blaminhor-essentials-section h2 {
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-gray-800);
}

.blaminhor-essentials-section > .description {
    margin: 0 0 16px;
    color: var(--ap-gray-500);
    font-size: 13px;
}

/* What's new block */
.blaminhor-essentials-whatsnew {
    border-left: 3px solid var(--ap-primary);
}

.blaminhor-essentials-whatsnew h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.blaminhor-essentials-whatsnew h2 .dashicons {
    color: var(--ap-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.blaminhor-essentials-whatsnew .whatsnew-text {
    margin: 0;
    color: var(--ap-gray-700);
    font-size: 13px;
    line-height: 1.6;
}

/* Modules Section Header */
.ap-modules-section .ap-modules-header {
    margin-bottom: 16px;
}

.ap-modules-section .ap-modules-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.ap-modules-section .ap-modules-title h2 {
    margin: 0;
}

.ap-modules-section .ap-modules-counter {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--ap-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

/* Category Tabs */
.ap-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #c3c4c7;
}

.ap-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    color: var(--ap-gray-700);
}

.ap-category-tab:hover {
    background: #f0f0f1;
    border-color: var(--ap-gray-400);
}

.ap-category-tab.active {
    background: var(--ap-primary);
    border-color: var(--ap-primary);
    color: #fff;
}

.ap-category-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ap-category-tab .tab-count {
    padding: 1px 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.ap-category-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Modules Grid */
.ap-modules-grid {
    display: none;
}

.ap-modules-grid.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

/* Module Card */
.ap-module-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ap-module-card:hover {
    border-color: var(--ap-primary-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ap-module-card.active {
    border-color: var(--ap-primary);
}

.ap-module-card .ap-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
}

.ap-module-card .ap-module-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    border-radius: 6px;
    color: var(--ap-gray-600);
}

.ap-module-card.active .ap-module-icon {
    background: var(--ap-primary);
    color: #fff;
}

.ap-module-card .ap-module-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ap-module-card .ap-module-body {
    padding: 0 12px 10px;
    flex: 1;
}

.ap-module-card .ap-module-name {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-gray-800);
}

.ap-module-card .ap-module-desc {
    margin: 0;
    font-size: 11px;
    color: var(--ap-gray-500);
    line-height: 1.4;
}

.ap-module-card .ap-module-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f6f7f7;
    border-top: 1px solid #c3c4c7;
    color: var(--ap-primary);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.ap-module-card .ap-module-settings:hover {
    background: #f0f0f1;
}

.ap-module-card .ap-module-settings .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Legacy Module Styles (for module settings pages) */
.blaminhor-essentials-module {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: var(--ap-border-radius);
    border: 1px solid #c3c4c7;
    transition: border-color 0.15s ease;
}

.blaminhor-essentials-module .module-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    border-radius: var(--ap-border-radius);
    flex-shrink: 0;
    color: var(--ap-gray-600);
}

.blaminhor-essentials-module .module-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.blaminhor-essentials-module .module-info {
    flex: 1;
    min-width: 140px;
}

.blaminhor-essentials-module .module-info h3 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-gray-800);
}

.blaminhor-essentials-module .module-info p {
    margin: 0;
    font-size: 12px;
    color: var(--ap-gray-500);
    line-height: 1.4;
}

/* Toggle Switch */
.blaminhor-essentials-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.blaminhor-essentials-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #8c8f94;
    transition: 0.2s;
    border-radius: 20px;
}

.blaminhor-essentials-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.blaminhor-essentials-switch input:checked + .slider {
    background-color: var(--ap-primary);
}

.blaminhor-essentials-switch input:checked + .slider:before {
    transform: translateX(16px);
}

.blaminhor-essentials-switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Feedback Form */
.feedback-form {
    max-width: 500px;
}

.feedback-form .form-field {
    margin-bottom: 16px;
}

.feedback-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-gray-700);
}

.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form select,
.feedback-form textarea {
    width: 100%;
    max-width: 400px;
}

.feedback-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* Support Links */
.support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f0f1;
    border-radius: var(--ap-border-radius);
    text-decoration: none;
    color: var(--ap-gray-700);
    font-size: 13px;
    transition: all 0.15s;
}

.support-link:hover {
    background: var(--ap-primary);
    color: #fff;
}

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

/* Credits */
.blaminhor-essentials-credits {
    text-align: center;
    padding: 16px;
    color: var(--ap-gray-400);
    font-size: 12px;
}

.blaminhor-essentials-credits a {
    color: var(--ap-primary);
    text-decoration: none;
}

.blaminhor-essentials-credits a:hover {
    text-decoration: underline;
}

/* Module Settings Pages - Common wrapper */
.blaminhor-essentials-settings-wrap {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    padding: 0;
    box-shadow: var(--ap-shadow);
}

/* Card wrapper (for modules without tabs) */
.blaminhor-essentials-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    box-shadow: var(--ap-shadow);
    padding: 20px;
}

/* Tabs */
.blaminhor-essentials-tabs-wrapper {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    box-shadow: var(--ap-shadow);
}

/* Padding for wrapper without tabs (e.g., Favicon module) */
.blaminhor-essentials-tabs-wrapper:not(:has(.blaminhor-essentials-tabs)) {
    padding: 20px;
}

.blaminhor-essentials-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #c3c4c7;
    background: #f6f7f7;
    border-radius: var(--ap-border-radius) var(--ap-border-radius) 0 0;
    padding: 0;
    margin: 0;
}

.blaminhor-essentials-tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--ap-gray-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
    /* Server-side tabs render as <a>; suppress default link underline. */
    text-decoration: none;
}

.blaminhor-essentials-tab:focus {
    text-decoration: none;
    box-shadow: none;
    outline: none;
}

.blaminhor-essentials-tab:focus-visible {
    outline: 2px solid var(--ap-primary);
    outline-offset: -4px;
}

.blaminhor-essentials-tab:hover {
    color: var(--ap-primary);
    background: rgba(0, 0, 0, 0.02);
}

.blaminhor-essentials-tab.active {
    color: var(--ap-gray-800);
    background: #fff;
    border-bottom-color: var(--ap-primary);
}

.blaminhor-essentials-tab-content {
    display: none;
    padding: 20px;
}

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

/* The form-level submit button lives outside any .tab-content (it persists
   across tabs), so it does NOT inherit the tab-content padding. Without this
   rule the button is flush against the wrapper's left border. */
.blaminhor-essentials-tabs-wrapper > form > .submit,
.blaminhor-essentials-tabs-wrapper > form > p.submit {
    padding: 0 20px 20px;
    margin: 0;
}

/* Critical CSS extractor — per-row busy feedback. */
.be-critical-generate.be-busy {
    pointer-events: none;
    opacity: 0.85;
}
.be-critical-generate.be-busy .spinner {
    visibility: visible;
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
}
em.be-critical-cell-busy {
    color: var(--ap-primary, #2271b1);
    font-style: italic;
}

/* Settings sections inside tabs */
.blaminhor-essentials-tab-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    padding: 0;
    color: var(--ap-gray-800);
}

.blaminhor-essentials-tab-content .description {
    color: var(--ap-gray-500);
    font-size: 13px;
    margin: 0 0 16px;
}

/* Form tables */
.blaminhor-essentials-tab-content .form-table {
    margin: 0 0 20px;
}

.blaminhor-essentials-tabs-wrapper .form-table th {
    padding: 12px 10px 12px 0;
    width: 200px;
    font-weight: 600;
    font-size: 13px;
    vertical-align: top;
}

.blaminhor-essentials-tabs-wrapper .form-table td {
    padding: 12px 0;
}

.blaminhor-essentials-tab-content .form-table td p.description {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ap-gray-500);
}

/* Notices */
.blaminhor-essentials-notice {
    padding: 10px 14px;
    border-radius: var(--ap-border-radius);
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 4px solid;
}

.blaminhor-essentials-notice.success {
    background: #edfaef;
    color: #1e4620;
    border-left-color: var(--ap-success);
}

.blaminhor-essentials-notice.error {
    background: #fcf0f1;
    color: #8a1c22;
    border-left-color: var(--ap-danger);
}

.blaminhor-essentials-notice.warning {
    background: #fcf9e8;
    color: #614c00;
    border-left-color: var(--ap-warning);
}

.blaminhor-essentials-notice.info {
    background: #f0f6fc;
    color: #1d4163;
    border-left-color: var(--ap-primary);
}

/* SMTP Module - General Settings Compact */
.smtp-general-settings-compact {
    background: var(--ap-gray-50);
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    padding: 16px 20px;
    margin-bottom: 0;
}

.smtp-general-settings-compact h3 {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-gray-700);
}

.smtp-settings-row {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.smtp-setting-col {
    flex: 1;
    max-width: 300px;
}

.smtp-setting-col > label:first-child {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-gray-700);
    margin-bottom: 6px;
}

.smtp-setting-col input[type="email"],
.smtp-setting-col input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
}

.smtp-settings-row-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #dcdcde;
    margin-bottom: 0;
}

.smtp-option-separator {
    color: var(--ap-gray-400);
}

.smtp-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ap-gray-700);
    cursor: pointer;
}

.smtp-checkbox-inline input[type="checkbox"] {
    margin: 0;
}

.smtp-retention-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ap-gray-700);
}

.smtp-retention-inline input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    font-size: 13px;
}

.smtp-settings-row-options .button {
    margin-left: auto;
}

.smtp-section-divider {
    border: none;
    border-top: 1px solid #c3c4c7;
    margin: 24px 0;
}

@media (max-width: 782px) {
    .smtp-settings-row {
        flex-direction: column;
        gap: 16px;
    }

    .smtp-setting-col {
        max-width: 100%;
    }

    .smtp-settings-row-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .smtp-option-separator {
        display: none;
    }

    .smtp-settings-row-options .button {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* SMTP Module - Provider select */
.smtp-provider-select-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.smtp-provider-select-wrapper label {
    margin: 0;
}

.smtp-provider-select {
    min-width: 250px;
    padding: 8px 12px;
    font-size: 14px;
}

/* SMTP Tutorial */
.smtp-tutorial {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: #f0f6fc;
    border: 1px solid #c3c4c7;
    border-left: 4px solid var(--ap-primary);
    border-radius: var(--ap-border-radius);
}

.smtp-tutorial h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ap-gray-800);
}

.smtp-tutorial ol {
    margin: 0 0 12px;
    padding-left: 20px;
    line-height: 1.8;
}

.smtp-tutorial .description {
    margin: 0;
    font-style: italic;
}

/* SMTP Relays List */
.smtp-relays-list {
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Enhanced relay list */
.smtp-relays-enhanced {
    border: 2px solid var(--ap-primary-light);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
}

.smtp-relay-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #c3c4c7;
    transition: background 0.15s;
}

.smtp-relays-enhanced .smtp-relay-item {
    padding: 16px 20px;
}

.smtp-relay-item:last-child {
    border-bottom: none;
}

/* Primary relay (first active) */
.smtp-relay-item.primary {
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f4fd 100%);
    border-left: 4px solid var(--ap-primary);
}

.smtp-relays-enhanced .smtp-relay-item.primary {
    padding-left: 16px;
}

/* Disabled relay - very clear visual */
.smtp-relay-item.disabled {
    background: #f6f7f7;
    opacity: 0.7;
}

.smtp-relay-item.disabled .relay-name,
.smtp-relay-item.disabled .relay-host {
    color: var(--ap-gray-400);
}

.smtp-relay-item.disabled .relay-name {
    text-decoration: line-through;
}

.smtp-relay-item .relay-handle {
    cursor: grab;
    color: var(--ap-gray-400);
    font-size: 16px;
}

.smtp-relay-item .relay-handle:hover {
    color: var(--ap-gray-600);
}

.smtp-relay-item .relay-info {
    flex: 1;
    min-width: 0;
}

.smtp-relay-item .relay-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    color: var(--ap-gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.smtp-relays-enhanced .smtp-relay-item .relay-name {
    font-size: 14px;
}

.relay-badge-primary {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--ap-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
}

.smtp-relay-item .relay-host {
    font-size: 12px;
    color: var(--ap-gray-500);
}

.smtp-relay-item .relay-status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.smtp-relay-item .relay-status.active {
    background: #edfaef;
    color: var(--ap-success);
}

.smtp-relay-item .relay-status.inactive {
    background: #f0f0f1;
    color: var(--ap-gray-500);
}

/* Relay actions - enhanced with labels */
.smtp-relay-item .relay-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.smtp-relays-enhanced .smtp-relay-item .relay-actions {
    gap: 8px;
}

.smtp-relay-item .relay-actions .button {
    padding: 0 8px;
    height: 28px;
    line-height: 26px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.smtp-relays-enhanced .smtp-relay-item .relay-actions .button {
    padding: 0 12px;
    height: 32px;
    font-size: 13px;
}

.smtp-relay-item .relay-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-top: -1px;
}

.smtp-relays-enhanced .smtp-relay-item .relay-actions .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.relay-action-label {
    display: none;
}

.smtp-relays-enhanced .relay-action-label {
    display: inline;
}

/* Delete button style */
.smtp-relay-item .relay-actions .button-link-delete {
    color: var(--ap-danger);
    padding: 0 6px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ap-border-radius);
    transition: all 0.15s;
}

.smtp-relay-item .relay-actions .button-link-delete:hover {
    background: #fcf0f1;
    border-color: var(--ap-danger);
}

.smtp-relay-item .relay-actions .button-link-delete .dashicons {
    margin: 0;
}

/* Email Log */
.email-log-table {
    width: 100%;
    border-collapse: collapse;
}

.email-log-table th,
.email-log-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #c3c4c7;
    font-size: 13px;
}

.email-log-table th {
    background: #f6f7f7;
    font-weight: 600;
    color: var(--ap-gray-700);
}

.email-log-table tbody tr:hover {
    background: #f6f7f7;
}

.email-log-table .status-sent {
    color: var(--ap-success);
    font-weight: 600;
}

.email-log-table .status-failed {
    color: var(--ap-danger);
    font-weight: 600;
}

.email-log-table .status-failed small {
    display: block;
    font-weight: 400;
    color: var(--ap-gray-500);
    margin-top: 2px;
}

/* Duplicator specific */
.duplicator-post-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}

.duplicator-post-types label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f6f7f7;
    border-radius: var(--ap-border-radius);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 13px;
}

.duplicator-post-types label:hover {
    background: #f0f0f1;
}

/* ========================================
   Utility Classes
   ======================================== */
.ap-hidden { display: none !important; }
.ap-inline-form { display: inline; }
.ap-nowrap { white-space: nowrap; }
.ap-table-empty { text-align: center; padding: 20px; }
.ap-actions-row { display: flex; gap: 10px; justify-content: flex-end; }
.ap-label-block { display: block; margin-bottom: 6px; }
.ap-label-flex { display: flex; align-items: center; gap: 8px; }
.ap-label-between { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 6px; }
.ap-icon-16 { font-size: 16px; width: 16px; height: 16px; }
.ap-icon-14 { font-size: 14px; width: 14px; height: 14px; }
.dashicons.ap-icon-mr { margin-right: 5px; }

/* Flex utilities */
.ap-flex { display: flex; }
.ap-inline-flex { display: inline-flex; }
.ap-flex-center { display: flex; align-items: center; }
.ap-inline-flex-center { display: inline-flex; align-items: center; }
.ap-flex-between { display: flex; align-items: center; justify-content: space-between; }
.ap-flex-wrap { flex-wrap: wrap; }
.ap-gap-sm { gap: 8px; }
.ap-gap-md { gap: 12px; }
.ap-gap-lg { gap: 16px; }

/* Margin utilities — scale: xs=4, sm=10, md=16, lg=24 */
.ap-mt-0 { margin-top: 0; }
.ap-mt-xs { margin-top: 4px; }
.ap-mt-sm { margin-top: 10px; }
.ap-mt-md { margin-top: 16px; }
.ap-mt-lg { margin-top: 24px; }
.ap-mb-0 { margin-bottom: 0; }
.ap-mb-xs { margin-bottom: 4px; }
.ap-mb-sm { margin-bottom: 10px; }
.ap-mb-md { margin-bottom: 16px; }
.ap-mb-lg { margin-bottom: 24px; }
.ap-mr-xs { margin-right: 4px; }

/* Text color utilities */
.ap-text-danger { color: #d63638; }
.ap-text-success { color: #00a32a; }
.ap-text-warning { color: #dba617; }
.ap-text-primary { color: #2271b1; }
.ap-text-gray { color: #646970; }
.ap-text-light-gray { color: #c3c4c7; }
.ap-text-muted { color: #888; }

/* Misc utilities */
.ap-code { font-size: 11px; background: #f0f0f1; padding: 2px 6px; border-radius: 3px; }
.dashicons.ap-dashicon-align { vertical-align: text-bottom; }

/* Responsive */
@media (max-width: 782px) {
    .blaminhor-essentials-wrap {
        margin-right: 10px;
    }

    /* New category tabs responsive */
    .ap-category-tabs {
        gap: 6px;
    }

    .ap-category-tab {
        padding: 6px 10px;
        font-size: 12px;
    }

    .ap-category-tab .tab-name {
        display: none;
    }

    .ap-modules-grid.active {
        grid-template-columns: 1fr;
    }

    /* Legacy responsive */
    .blaminhor-essentials-modules {
        grid-template-columns: 1fr;
    }

    .blaminhor-essentials-module {
        flex-direction: column;
    }

    .blaminhor-essentials-tabs {
        flex-wrap: wrap;
    }

    .blaminhor-essentials-tab {
        flex: 1;
        text-align: center;
        min-width: 100px;
    }

    .blaminhor-essentials-tab-content .form-table th {
        display: block;
        width: 100%;
        padding-bottom: 4px;
    }

    .blaminhor-essentials-tab-content .form-table td {
        display: block;
        padding-top: 0;
    }

    .smtp-relay-item {
        flex-wrap: wrap;
    }

    .smtp-relay-item .relay-actions {
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #c3c4c7;
        justify-content: flex-end;
    }
}

/* Spinner animation for testing */
@keyframes ap-spin {
    to {
        transform: rotate(360deg);
    }
}

.dashicons.spin {
    animation: ap-spin 1s linear infinite;
}

/* Settings section divider */
.blaminhor-essentials-tab-content hr {
    border: none;
    border-top: 1px solid #c3c4c7;
    margin: 24px 0;
}

/* Submit buttons alignment */
.blaminhor-essentials-tab-content .submit,
.blaminhor-essentials-wrap .ap-form-submit {
    margin: 0 0 20px;
    padding: 16px 12px 0;
    border-top: 1px solid #c3c4c7;
}

/* Setting-row highlight: applied by admin.js when the user lands on a tab
 * via an audit recommendation link (e.g. "#page-cache:browser_cache_enabled").
 * Pulses the row a few times so the eye finds the right setting fast. */
.blaminhor-essentials-highlight {
    animation: blaminhor-essentials-highlight-flash 1.2s ease-in-out 3;
    border-radius: 4px;
}
@keyframes blaminhor-essentials-highlight-flash {
    0%, 100% { background-color: transparent; box-shadow: none; }
    50% { background-color: #fff8c5; box-shadow: 0 0 0 4px #fff8c5; }
}

/* Audit results — built by cache-admin.js renderAudit().
 * Aligned with the rest of the plugin: --ap-* variables, .blaminhor-essentials-*
 * spacing, no inline styles. */
#be-audit-results {
    margin-top: 12px;
}
.be-audit-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--ap-gray-50);
    border: 1px solid #c3c4c7;
    border-left: 4px solid var(--ap-primary);
    border-radius: var(--ap-border-radius);
    margin-bottom: 20px;
    box-shadow: var(--ap-shadow);
}
.be-audit-summary--good { border-left-color: var(--ap-success); }
.be-audit-summary--warn { border-left-color: var(--ap-warning); }
.be-audit-summary--bad  { border-left-color: var(--ap-danger); }
.be-audit-score {
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    color: var(--ap-gray-700);
    min-width: 64px;
    text-align: center;
}
.be-audit-summary--good .be-audit-score { color: var(--ap-success); }
.be-audit-summary--warn .be-audit-score { color: var(--ap-warning); }
.be-audit-summary--bad  .be-audit-score { color: var(--ap-danger); }
.be-audit-engine {
    flex: 1;
    min-width: 0;
}
.be-audit-engine strong {
    font-size: 14px;
    color: var(--ap-gray-800);
}
.be-audit-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--ap-gray-500);
}
.be-audit-metrics code {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    padding: 1px 6px;
    color: var(--ap-gray-700);
    font-size: 11px;
}
.be-audit-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ap-gray-800);
}
.be-audit-group-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ap-gray-400);
    flex-shrink: 0;
}
.be-audit-group--plugin  .be-audit-group-dot { background: var(--ap-success); }
.be-audit-group--mixed   .be-audit-group-dot { background: var(--ap-warning); }
.be-audit-group--theme   .be-audit-group-dot { background: #d6a900; }
.be-audit-group--hosting .be-audit-group-dot { background: var(--ap-danger); }
.be-audit-group-count {
    color: var(--ap-gray-500);
    font-weight: 400;
}
.be-audit-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: var(--ap-border-radius);
    padding: 14px 16px;
    margin: 8px 0;
    box-shadow: var(--ap-shadow);
}
.be-audit-card-title {
    font-size: 13px;
    color: var(--ap-gray-800);
}
.be-audit-card-value {
    color: var(--ap-gray-500);
    font-weight: 400;
    font-size: 12px;
}
.be-audit-card-desc {
    margin: 6px 0 4px;
    font-size: 13px;
    color: var(--ap-gray-700);
    line-height: 1.5;
}
.be-audit-card-guidance {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--ap-gray-500);
    line-height: 1.5;
}
.be-audit-card .button {
    margin-top: 10px;
}
/* A recommendation whose underlying toggle is already on — kept visible so
 * the user can see what's been addressed, but visually demoted. */
.be-audit-card--resolved {
    opacity: 0.55;
    background: #f6f7f7;
}
.be-audit-card--resolved .be-audit-card-title {
    text-decoration: line-through;
}
.be-audit-card-resolved-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--ap-success);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
}
.be-audit-card-resolved-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}
