/**
 * Guard Dog Settings Page Styles
 *
 * @package GuardDog
 * @since 1.8.0
 */

/* Email Provider Test Section */
.guard-dog-email-provider-test {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.guard-dog-email-provider-test h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.guard-dog-email-provider-test p {
    margin-bottom: 15px;
    color: #666;
}

.guard-dog-email-provider-test .form-table {
    margin-bottom: 15px;
}

.guard-dog-email-provider-test .button {
    margin-right: 10px;
}

#test-email-result {
    margin-top: 10px;
}

#test-email-result .notice {
    margin: 0;
    padding: 8px 12px;
}

#test-email-result .notice p {
    margin: 0;
}

/* Fix duplicate ID warnings */
.guard-dog-settings-page input[id*="_wpnonce_"],
.guard-dog-settings-page input[id*="guard_dog_nonce_"] {
    /* These are dynamically generated unique IDs */
}

/**
 * Settings Page Styles
 *
 * @package GuardDog
 * @since 1.1.0
 */

/* Tabbed Interface */
.guard-dog-tabbed-interface {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.guard-dog-tab-nav {
    display: flex;
    background: #f9f9f9;
    border-bottom: 1px solid #ccd0d4;
}

.guard-dog-tab-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-right: 1px solid #e1e1e1;
    transition: all 0.2s ease;
    cursor: pointer;
}

.guard-dog-tab-link:hover {
    background: #fff;
    color: #0073aa;
}

.guard-dog-tab-link.active {
    background: #fff;
    color: #0073aa;
    border-bottom: 1px solid #0073aa;
}

.guard-dog-tab-link .dashicons {
    font-size: 16px;
}

.guard-dog-tab-content {
    padding: 0;
}

.guard-dog-tab-panel {
    display: none;
    padding: 25px;
}

.guard-dog-tab-panel.active {
    display: block;
}

.guard-dog-tab-panel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guard-dog-tab-panel h3 .dashicons {
    color: #0073aa;
}

.guard-dog-tab-panel p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

/* Feature-Specific Styles for Settings Page */

/* Data Management */
.guard-dog-data-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.guard-dog-data-management-button {
    width: 100%;
    margin-bottom: 8px;
}

.guard-dog-data-management-description {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.guard-dog-warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.guard-dog-warning-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
}

.guard-dog-warning-box p {
    margin-bottom: 15px;
    color: #856404;
}

.guard-dog-reset-button {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.guard-dog-reset-button:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

.guard-dog-info-box {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.guard-dog-info-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0c5460;
}

.guard-dog-info-box p {
    margin-bottom: 0;
    color: #0c5460;
}

.guard-dog-info-box a {
    color: #0c5460;
    text-decoration: underline;
}

.guard-dog-info-box a:hover {
    color: #0a3d44;
}

.guard-dog-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.guard-dog-info-item:last-child {
    border-bottom: none;
}

.guard-dog-info-label {
    font-weight: 500;
    color: #333;
}

.guard-dog-info-value {
    font-family: monospace;
    color: #666;
    font-size: 13px;
}

.guard-dog-tools-button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

.guard-dog-tools-button-last {
    margin-bottom: 0;
}

/* Health Check Results */
.guard-dog-health-check-results {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.guard-dog-health-check-results h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #23282d;
    font-size: 18px;
    font-weight: 600;
}

.guard-dog-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.guard-dog-health-section {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
}

.guard-dog-health-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #23282d;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guard-dog-health-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.guard-dog-health-section li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.guard-dog-health-section li:last-child {
    margin-bottom: 0;
}

.guard-dog-health-section .dashicons {
    margin-right: 8px;
    font-size: 16px;
}

.guard-dog-health-section .dashicons-yes-alt {
    color: #46b450;
}

.guard-dog-health-section .dashicons-no-alt {
    color: #dc3232;
}

.guard-dog-health-section .dashicons-info,
.guard-dog-health-section .dashicons-chart-bar,
.guard-dog-health-section .dashicons-admin-tools,
.guard-dog-health-section .dashicons-shield,
.guard-dog-health-section .dashicons-performance,
.guard-dog-health-section .dashicons-clock {
    color: #0073aa;
}

.guard-dog-health-actions {
    text-align: right;
    border-top: 1px solid #e5e5e5;
    padding-top: 15px;
    margin-top: 15px;
}

/* Debug Log Viewer */
.guard-dog-debug-log-viewer {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    margin-bottom: 24px;
    padding: 18px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.guard-dog-debug-log-viewer__header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.guard-dog-debug-log-viewer__header h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: #23282d;
}

.guard-dog-debug-log-viewer__header p {
    margin: 0;
}

.guard-dog-debug-log-viewer__meta {
    display: grid;
    gap: 6px;
    min-width: 280px;
    font-size: 12px;
    color: #50575e;
}

.guard-dog-debug-log-viewer__meta code {
    word-break: break-all;
}

.guard-dog-debug-log-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.guard-dog-debug-log-summary__item {
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
}

.guard-dog-debug-log-summary__label {
    display: block;
    color: #50575e;
    font-size: 12px;
    margin-bottom: 4px;
}

.guard-dog-debug-log-empty {
    background: #f6f7f7;
    border: 1px dashed #ccd0d4;
    border-radius: 6px;
    padding: 16px;
}

.guard-dog-debug-log-empty p {
    margin: 0;
}

.guard-dog-debug-log-entries {
    display: grid;
    gap: 14px;
    max-height: 900px;
    overflow: auto;
    padding-right: 4px;
}

.guard-dog-debug-log-entry {
    border: 1px solid #e0e0e0;
    border-left-width: 4px;
    border-radius: 6px;
    background: #fbfbfb;
    padding: 14px;
}

.guard-dog-debug-log-entry--error {
    border-left-color: #d63638;
}

.guard-dog-debug-log-entry--warning {
    border-left-color: #dba617;
}

.guard-dog-debug-log-entry--info {
    border-left-color: #2271b1;
}

.guard-dog-debug-log-entry--debug {
    border-left-color: #646970;
}

.guard-dog-debug-log-entry__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.guard-dog-debug-log-entry__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.guard-dog-debug-log-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.guard-dog-debug-log-badge--error {
    background: #fbeaea;
    color: #8a1f11;
}

.guard-dog-debug-log-badge--warning {
    background: #fff4d6;
    color: #8a5a00;
}

.guard-dog-debug-log-badge--info {
    background: #e7f1fb;
    color: #0a4b78;
}

.guard-dog-debug-log-badge--debug {
    background: #eef0f1;
    color: #3c434a;
}

.guard-dog-debug-log-badge--source {
    background: #f0f6fc;
    color: #1d4f7a;
}

.guard-dog-debug-log-entry__component,
.guard-dog-debug-log-entry__timestamp {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    color: #50575e;
}

.guard-dog-debug-log-entry__message,
.guard-dog-debug-log-entry__context {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #1d2327;
}

.guard-dog-debug-log-entry__context-label {
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Support Report Viewer */
.guard-dog-support-report {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 6px;
    margin-bottom: 24px;
    padding: 18px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.guard-dog-support-report__header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.guard-dog-support-report__header h3 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guard-dog-support-report__header p {
    margin: 0;
    color: #50575e;
}

.guard-dog-support-report__meta {
    display: grid;
    gap: 6px;
    min-width: 320px;
    font-size: 12px;
    color: #50575e;
}

.guard-dog-support-report__meta code {
    word-break: break-all;
}

.guard-dog-support-report__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.guard-dog-support-report__summary-item {
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 14px;
}

.guard-dog-support-report__summary-label {
    display: block;
    color: #50575e;
    font-size: 12px;
    margin-bottom: 4px;
}

.guard-dog-support-report__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.guard-dog-support-report__section {
    background: #f6f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
}

.guard-dog-support-report__section h4 {
    margin-top: 0;
    margin-bottom: 12px;
}

.guard-dog-support-report__facts {
    display: grid;
    gap: 10px;
}

.guard-dog-support-report__fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.guard-dog-support-report__fact-label {
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.guard-dog-support-report__fact-value {
    word-break: break-word;
    color: #1d2327;
}

.guard-dog-support-report__details {
    margin-top: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fbfbfb;
}

.guard-dog-support-report__details summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    color: #1d2327;
}

.guard-dog-support-report__plugin-list {
    margin: 0;
    padding: 0 24px 16px 36px;
}

.guard-dog-support-report__activity {
    display: grid;
    gap: 14px;
}

.guard-dog-support-report__activity-entry {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fbfbfb;
    padding: 14px;
}

.guard-dog-support-report__activity-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.guard-dog-support-report__activity-header time,
.guard-dog-support-report__activity-meta {
    color: #50575e;
    font-size: 12px;
}

.guard-dog-support-report__activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.guard-dog-support-report__code {
    margin: 0;
    padding: 12px 14px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    background: #fff;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #1d2327;
}

.guard-dog-support-report__empty {
    background: #f6f7f7;
    border: 1px dashed #ccd0d4;
    border-radius: 6px;
    padding: 16px;
}

.guard-dog-support-report__empty p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .guard-dog-data-management-grid {
        grid-template-columns: 1fr;
    }
    
    .guard-dog-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .guard-dog-tab-nav {
        flex-direction: column;
    }
    
    .guard-dog-tab-link {
        border-right: none;
        border-bottom: 1px solid #e1e1e1;
    }

    /* Responsive adjustments */
    .guard-dog-health-grid {
        grid-template-columns: 1fr;
    }

    .guard-dog-debug-log-viewer__header,
    .guard-dog-debug-log-entry__header {
        flex-direction: column;
    }

    .guard-dog-debug-log-viewer__meta {
        min-width: 0;
    }

    .guard-dog-support-report__header,
    .guard-dog-support-report__activity-header {
        flex-direction: column;
    }

    .guard-dog-support-report__meta {
        min-width: 0;
    }
}
