/**
 * Admin Styles - Diagnostic Glance
 * FILE: assets/css/admin.css
 *
 * Styles for dashboard widget, configuration interface, and admin elements.
 * Modernized with CSS Grid, improved accessibility, and better responsive design.
 *
 * @package DiagnosticGlance
 * @subpackage Assets
 * @since 1.1.0
 */

/* ==========================================================================
   Dashboard Widget Styles
   ========================================================================== */

.diagnostic-glance-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
}

.diagnostic-output {
    border: 1px solid #dbf3ff;
    padding: 0.75em 1em;
    background: #f8fcff;
    background-image: url(../images/LOW_background_logo.png), linear-gradient(to bottom, #f5fbff 0%, #dbeefc 100%);
    background-repeat: no-repeat;
    background-position: top right;
    border-radius: 4px;
    word-wrap: break-word;
    overflow: auto;
    max-height: 400px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    tab-size: 4;
    color: #23282d;
}

.diagnostic-output:focus {
    outline: 2px solid #005cee;
    outline-offset: 2px;
}

.diagnostic-output-frontend {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================================================================
   Widget Controls
   ========================================================================== */

.ldg-shortcode {
    width: 100%;
    max-width: 200px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-family: monospace;
    font-size: 12px;
    margin: 0 8px 0 0;
}

.ldg-shortcode:focus {
    border-color: #005cee;
    box-shadow: 0 0 0 1px #005cee;
    outline: none;
}

.low-select-me {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    padding: 6px 12px;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.low-select-me:hover,
.low-select-me:focus {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
    box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6);
}

.low-select-me:active {
    background: #004c70;
    border-color: #004c70;
    box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.15);
}

.low-select-me:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==========================================================================
   Configuration Interface
   ========================================================================== */

.diagnostic-glance-config h3 {
    margin-top: 0;
    color: #23282d;
    font-size: 16px;
    font-weight: 600;
}

.diagnostic-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .diagnostic-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .diagnostic-options {
        grid-template-columns: 1fr;
    }
}

/* Toggle Cards */
.ldg-toggle-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ldg-toggle-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.1);
}

.ldg-toggle-label {
    font-weight: 600;
    color: #1d2327;
    font-size: 13px;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
}

/* Pill Toggle Switch */
.ldg-pill-checkbox-wrapper {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.ldg-pill-checkbox-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ldg-pill-checkbox-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #8c8f94;
    border-radius: 22px;
    transition: 0.3s;
    cursor: pointer;
}

.ldg-pill-checkbox-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Active State */
.ldg-pill-checkbox-input:checked+.ldg-pill-checkbox-slider {
    background-color: #2271b1;
}

.ldg-pill-checkbox-input:checked+.ldg-pill-checkbox-slider:before {
    transform: translateX(22px);
}

/* Focus State for Accessibility */
.ldg-pill-checkbox-input:focus+.ldg-pill-checkbox-slider {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
    outline: none;
}

/* Disabled State */
.ldg-pill-checkbox-input:disabled+.ldg-pill-checkbox-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hover Effects */
.ldg-pill-checkbox-wrapper:hover .ldg-pill-checkbox-slider:not(:has(.ldg-pill-checkbox-input:disabled)) {
    opacity: 0.9;
}

.ldg-pill-checkbox-input:checked+.ldg-pill-checkbox-slider:hover {
    background-color: #1e5a8a;
}

/* ==========================================================================
   Options Status Display
   ========================================================================== */

.ldg-options-key {
    margin: 16px 0;
    padding: 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.08) 100%);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ldg-options-key .inner {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.ldg-options-key .inner span {
    padding: 0 8px 4px 8px;
    font-size: 12px;
    color: #666;
}

.ldg-options-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

@media (max-width: 600px) {
    .ldg-options-list {
        grid-template-columns: 1fr;
    }
}

.ldg-options-item {
    padding: 6px 8px;
    border-radius: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ldg-option-visible {
    background: linear-gradient(to bottom, rgba(127, 218, 255, 0.3) 0%, rgba(80, 135, 160, 0.3) 100%);
    border: 1px solid rgba(80, 135, 160, 0.2);
}

.ldg-option-hidden {
    background: linear-gradient(to bottom, rgba(229, 223, 142, 0.3) 0%, rgba(198, 198, 85, 0.3) 100%);
    border: 1px solid rgba(198, 198, 85, 0.2);
}

.ldg-visible-svg,
.ldg-hidden-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ==========================================================================
   Notice Styles
   ========================================================================== */

.ldg-note {
    padding: 12px;
    margin: 16px 0;
    background: linear-gradient(to bottom, rgba(255, 246, 127, 0.4) 0%, rgba(255, 233, 0, 0.4) 100%);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 4px;
    border-left: 4px solid #ffc107;
}

.ldg-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.ldg-note strong {
    color: #23282d;
}

/* ==========================================================================
   Admin Notice System - Review/Donation Notifications
   ========================================================================== */

.diagnostic-glance-review-notice {
    border-left-color: #2271b1 !important;
}

/* Notification Layout */
.diagnostic-glance-notice-content {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 12px;
}

.diagnostic-glance-notice-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Notification Badge - Perfect Circle with Spacing */
.diagnostic-glance-notification-badge {
    background: #d63638;
    color: white;
    border-radius: 50%;
    padding: 0;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    display: inline-block;
    margin-right: 8px;
}

.diagnostic-glance-notice-button {
    text-decoration: none;
    vertical-align: baseline;
}

.diagnostic-glance-notice-button:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
}

/* Mobile responsiveness for admin notices */
@media (max-width: 768px) {
    .diagnostic-glance-notice-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .diagnostic-glance-notice-logo {
        margin: 0;
    }
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */

.low-wp-explain,
.diagnostic-footer {
    font-size: 12px;
    font-style: italic;
    color: #666;
    line-height: 1.4;
    margin-top: 12px;
}

.low-wp-explain a,
.diagnostic-footer a {
    color: #0073aa;
    text-decoration: none;
}

.low-wp-explain a:hover,
.low-wp-explain a:focus,
.diagnostic-footer a:hover,
.diagnostic-footer a:focus {
    color: #005a87;
    text-decoration: underline;
}

.diagnostic-glance-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* ==========================================================================
   Hidden Elements
   ========================================================================== */

#ldg-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */

.diagnostic-glance-widget *:focus,
.diagnostic-glance-config *:focus {
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .diagnostic-output {
        border-color: #000;
        background: #fff;
    }

    .ldg-option-visible,
    .ldg-option-hidden {
        border-color: #000;
        background: #fff;
    }

    .ldg-options-key {
        border-color: #000;
        background: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .low-select-me,
    .diagnostic-options label {
        transition: none;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .low-select-me,
    .ldg-shortcode,
    .diagnostic-footer,
    .low-wp-explain {
        display: none !important;
    }

    .diagnostic-output,
    .diagnostic-output-frontend {
        background: #fff !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 782px) {
    .diagnostic-output {
        font-size: 11px;
        padding: 0.5em;
        max-height: 300px;
    }

    .ldg-shortcode {
        max-width: 150px;
        font-size: 11px;
    }

    .low-select-me {
        padding: 4px 8px;
        font-size: 12px;
    }

    .ldg-options-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .diagnostic-output {
        font-size: 10px;
        max-height: 200px;
    }

    .ldg-shortcode {
        width: 100%;
        max-width: none;
        margin-bottom: 8px;
    }

    .low-select-me {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.diagnostic-glance-widget .screen-reader-text,
.diagnostic-glance-config .screen-reader-text {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.diagnostic-glance-widget .clearfix::after,
.diagnostic-glance-config .clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Animation for successful copy action */
@keyframes copy-success {
    0% {
        background-color: #0073aa;
    }

    50% {
        background-color: #00a32a;
    }

    100% {
        background-color: #0073aa;
    }
}

.low-select-me.copy-success {
    animation: copy-success 0.6s ease-in-out;
}

/* ==========================================================================
   WordPress Admin Color Scheme Compatibility
   ========================================================================== */

.admin-color-fresh .low-select-me {
    background: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
}

.admin-color-fresh .low-select-me:hover,
.admin-color-fresh .low-select-me:focus {
    background: #005a87;
    border-color: #005a87;
    color: #ffffff;
}

.admin-color-light .low-select-me {
    background: #04a4cc;
    border-color: #04a4cc;
    color: #ffffff;
}

.admin-color-light .low-select-me:hover,
.admin-color-light .low-select-me:focus {
    background: #037c9a;
    border-color: #037c9a;
    color: #ffffff;
}