/* ========================================
   Accessibility Styles v1.6.0
   ======================================== */

/* Screen reader only content */
.claude-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip link */
.claude-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #10b981;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 1000000;
    font-weight: 500;
    transition: top 0.3s;
}

.claude-skip-link:focus {
    top: 0;
    outline: 3px solid #059669;
    outline-offset: 2px;
}

/* Focus visible styles */
.claude-pro-chat-button:focus-visible,
.claude-pro-chat-send:focus-visible,
.claude-pro-chat-close:focus-visible {
    outline: 3px solid #10b981;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.claude-pro-chat-input:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: -2px;
    border-color: #10b981;
}

/* Keyboard shortcuts display */
.claude-shortcuts {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-width: 400px;
}

.claude-shortcuts h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.claude-shortcuts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.claude-shortcuts li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.claude-shortcuts li:last-child {
    border-bottom: none;
}

.claude-shortcuts kbd {
    display: inline-block;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-right: 12px;
    min-width: 120px;
    text-align: center;
    color: #374151;
}

/* High contrast mode enhancements */
@media (prefers-contrast: high) {
    .claude-pro-chat-button:focus-visible,
    .claude-pro-chat-send:focus-visible,
    .claude-pro-chat-close:focus-visible {
        outline-width: 4px;
        outline-color: #000;
    }
    
    .claude-pro-chat-input:focus-visible {
        outline-width: 3px;
        border-width: 2px;
    }
    
    .claude-shortcuts kbd {
        border-width: 2px;
        border-color: #000;
    }
}

/* Focus ring for all interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Remove outline for mouse users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
    outline: none;
}

/* Keyboard navigation indicator */
.claude-pro-chatbot.keyboard-nav *:focus {
    outline: 3px solid #10b981 !important;
    outline-offset: 2px !important;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    .claude-skip-link {
        transition: none;
    }
}

/* Screen reader announcements */
#claude-announcer {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Inert styles for background when chat is open */
[inert] {
    pointer-events: none;
    cursor: default;
}

[inert] * {
    pointer-events: none;
    cursor: default;
}

/* Loading state with accessible indication */
.claude-loading-accessible::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.claude-loading-accessible[aria-busy="true"]::before {
    content: 'Cargando...';
    position: absolute;
    left: -10000px;
}

/* Touch target size for mobile (minimum 44x44px) */
@media (max-width: 768px) {
    .claude-pro-chat-button,
    .claude-pro-chat-close,
    .claude-pro-chat-send {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Keyboard shortcuts modal backdrop */
.claude-shortcuts-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
}

.claude-shortcuts-backdrop .claude-shortcuts {
    position: relative;
    z-index: 999999;
}

/* Error messages with proper color contrast */
.claude-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.claude-error-message::before {
    content: '⚠';
    font-size: 20px;
}

/* Success messages */
.claude-success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.claude-success-message::before {
    content: '✓';
    font-size: 20px;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .claude-shortcuts {
        background: #1f2937;
        color: #e5e7eb;
    }
    
    .claude-shortcuts h3 {
        color: #f9fafb;
    }
    
    .claude-shortcuts kbd {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .claude-shortcuts li {
        border-bottom-color: #374151;
    }
    
    .claude-error-message {
        background: #7f1d1d;
        border-color: #991b1b;
        color: #fecaca;
    }
    
    .claude-success-message {
        background: #14532d;
        border-color: #166534;
        color: #bbf7d0;
    }
}
