/* Publisher Checklist Gutenberg Sidebar Styles */

.magiccl-publisher-sidebar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header Button Styles */
.magiccl-header-button-container {
    display: flex;
    align-items: center;
}

.magiccl-header-button {
    position: relative;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    height: 36px !important;
    min-height: 36px !important;
}

.magiccl-header-button:hover {
    background: #f0f0f0 !important;
}

.magiccl-header-button.is-pressed {
    background: #e0e0e0 !important;
}

.magiccl-header-button:focus {
    box-shadow: inset 0 0 0 1px #f2da22, inset 0 0 0 2px #fff !important;
    outline: none !important;
}

.magiccl-header-button-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.magiccl-header-button-text {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1e1e1e;
    white-space: nowrap;
}

/* Status Colors */
.magiccl-status-passed {
    background-color: #22c55e;
}

.magiccl-status-failed {
    background-color: #ef4444;
}

.magiccl-status-pending {
    background-color: #f59e0b;
}

.magiccl-status-none {
    background-color: #64748b;
}

/* Sidebar Panel Styles */
.magiccl-publisher-sidebar .components-panel__body-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
}

.magiccl-publisher-sidebar .components-panel__body {
    border-bottom: 1px solid #e2e8f0 !important;
    background: #fff !important;
}

.magiccl-publisher-sidebar .components-panel__body:last-child {
    border-bottom: none !important;
}

.magiccl-publisher-sidebar .components-panel__body-toggle {
    padding: 16px !important;
}

.magiccl-requirements-list {
    margin: 0;
    padding: 0;
}

.magiccl-requirement-item {
    margin-bottom: 12px !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
    background: #fff;
    position: relative;
}

.magiccl-requirement-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.magiccl-requirement-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
    background: transparent;
    transition: background-color 0.2s ease;
}

.magiccl-requirement-item.passed {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.magiccl-requirement-item.passed::before {
    background-color: #22c55e;
}

.magiccl-requirement-item.failed {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.magiccl-requirement-item.failed::before {
    background-color: #ef4444;
}

.magiccl-requirement-item.pending {
    background-color: #fffbeb;
    border-color: #fed7aa;
}

.magiccl-requirement-item.pending::before {
    background-color: #f59e0b;
}

.magiccl-requirement-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.magiccl-requirement-icon {
    font-size: 16px;
    line-height: 1.2;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.magiccl-requirement-details {
    flex: 1;
    min-width: 0;
}

.magiccl-requirement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.magiccl-requirement-title {
    font-weight: 500;
    font-size: 14px;
    color: #1a1a1a;
    margin: 0;
}

.magiccl-required-badge {
    background: #f2da22;
    color: #1a1a1a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.magiccl-requirement-description {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.magiccl-requirement-message {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.3;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.8);
}

.magiccl-requirement-message.passed {
    color: #15803d;
    background: rgba(34, 197, 94, 0.1);
}

.magiccl-requirement-message.failed {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

.magiccl-requirement-message.pending {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.magiccl-requirement-message.error {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.magiccl-publisher-sidebar .components-checkbox-control__label {
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 400 !important;
}

.magiccl-publisher-sidebar .components-base-control__field {
    margin-bottom: 0 !important;
}

.magiccl-publisher-sidebar .components-checkbox-control__input[type="checkbox"] {
    margin-right: 8px !important;
}

/* Status indicators */
.magiccl-status-summary {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    border-left: 4px solid #e2e8f0;
}

.magiccl-status-summary.passed {
    background: #f0fdf4;
    color: #15803d;
    border-left-color: #22c55e;
}

.magiccl-status-summary.failed {
    background: #fef2f2;
    color: #dc2626;
    border-left-color: #ef4444;
}

.magiccl-status-summary.pending {
    background: #fffbeb;
    color: #d97706;
    border-left-color: #f59e0b;
}

.magiccl-status-text {
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.magiccl-last-check {
    color: #64748b;
    font-size: 11px;
    opacity: 0.8;
}

/* Check requirements button */
.magiccl-publisher-sidebar .components-button.is-secondary {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 12px !important;
    font-size: 13px !important;
    padding: 8px 16px !important;
    height: auto !important;
    border-color: #e2e8f0 !important;
    transition: all 0.2s ease !important;
}

.magiccl-publisher-sidebar .components-button.is-secondary:hover {
    border-color: #f2da22 !important;
    background: #fffef7 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.magiccl-publisher-sidebar .components-button.is-secondary:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Loading states */
.magiccl-checking .magiccl-requirement-item {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes magiccl-pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

.magiccl-checking .magiccl-requirement-item {
    animation: magiccl-pulse 1.5s ease-in-out infinite;
}

@keyframes magiccl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.magiccl-spinner {
    animation: magiccl-spin 1s linear infinite;
}

.magiccl-publisher-sidebar .components-spinner {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

/* Panel body content */
.magiccl-publisher-sidebar .components-panel__body-content {
    padding: 0 16px 16px 16px !important;
}

/* Empty state */
.magiccl-no-checklists {
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.magiccl-no-checklists .dashicons {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Integration with Gutenberg's interface */
.interface-pinned-items .magiccl-header-button-container {
    margin-right: 8px;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .magiccl-header-button-text {
        display: none;
    }
    
    .magiccl-header-button {
        padding: 6px !important;
    }
    
    .magiccl-requirement-item {
        padding: 10px;
    }
    
    .magiccl-requirement-content {
        gap: 8px;
    }
    
    .magiccl-requirement-title {
        font-size: 13px;
    }
    
    .magiccl-requirement-description,
    .magiccl-requirement-message {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .magiccl-header-button-container {
        order: -1; /* Move before other buttons on mobile */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .magiccl-requirement-item {
        border-width: 2px;
    }
    
    .magiccl-required-badge {
        border: 1px solid #1a1a1a;
    }
    
    .magiccl-header-button-status {
        border: 2px solid white;
    }
}

/* Dark mode support (for future WordPress dark mode) */
@media (prefers-color-scheme: dark) {
    .magiccl-requirement-item {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .magiccl-requirement-title {
        color: #f9fafb;
    }
    
    .magiccl-requirement-description {
        color: #9ca3af;
    }
    
    .magiccl-status-summary {
        background: #111827;
    }
    
    .magiccl-header-button {
        color: #f9fafb !important;
    }
    
    .magiccl-header-button:hover {
        background: #374151 !important;
    }
}

/* Focus styles for accessibility */
.magiccl-publisher-sidebar .components-checkbox-control__input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px #f2da22 !important;
    outline: none !important;
}

.magiccl-publisher-sidebar .components-button:focus {
    box-shadow: 0 0 0 2px #f2da22 !important;
    outline: none !important;
}

/* Smooth transitions */
.magiccl-requirement-item,
.magiccl-status-summary,
.magiccl-publisher-sidebar .components-button,
.magiccl-header-button {
    transition: all 0.2s ease;
}

/* Ensure proper text selection */
.magiccl-requirement-description,
.magiccl-requirement-message {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Tooltip support for header button */
.magiccl-header-button[title]::after {
    content: attr(title);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100000;
}

.magiccl-header-button:hover[title]::after {
    opacity: 1;
}

/* Panel body animations */
.magiccl-publisher-sidebar .components-panel__body {
    transition: all 0.3s ease;
}

/* Status indicator animations */
.magiccl-requirement-icon {
    transition: transform 0.2s ease;
}

.magiccl-requirement-item:hover .magiccl-requirement-icon {
    transform: scale(1.1);
}

/* Checklist health indicator */
.magiccl-checklist-health {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255,255,255,0.8);
}

.magiccl-checklist-health.healthy {
    color: #15803d;
    background: rgba(34, 197, 94, 0.1);
}

.magiccl-checklist-health.warning {
    color: #d97706;
    background: rgba(245, 158, 11, 0.1);
}

.magiccl-checklist-health.critical {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* Visual feedback for blocked publishing */
.editor-post-publish-button.is-locked,
.editor-post-publish-panel__toggle.is-locked {
    position: relative;
    cursor: pointer !important;
}

.editor-post-publish-button.is-locked::after,
.editor-post-publish-panel__toggle.is-locked::after {
    content: '📋';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f2da22;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    animation: magiccl-pulse-icon 2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes magiccl-pulse-icon {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Highlight the checklist button when requirements are blocking */
.magiccl-requirements-blocking .magiccl-header-button {
    animation: magiccl-attention-pulse 3s ease-in-out infinite;
}

@keyframes magiccl-attention-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(242, 218, 34, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(242, 218, 34, 0.1);
    }
} 