/* Adaptive Mobile Experience Optimizer Styles */

/* Device-specific optimizations */
.device-mobile {
    font-size: 16px; /* Prevent zoom on iOS */
}

.device-mobile input,
.device-mobile textarea,
.device-mobile select {
    font-size: 16px; /* Prevent zoom on iOS */
}

/* Memory-based optimizations */
.memory-low .particle-effects,
.memory-low .complex-animation {
    display: none !important;
}

.memory-low * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
}

/* Connection-based optimizations */
.data-saver img:not(.essential) {
    background: #f0f0f0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.data-saver .particle-effects,
.data-saver .complex-animation {
    display: none;
}

/* Screen size optimizations */
.small-screen {
    font-size: 14px;
}

.small-screen .container {
    padding: 10px;
}

.small-screen .btn {
    padding: 8px 12px;
    font-size: 14px;
}

.small-screen .section-title {
    font-size: 1.2rem;
}

/* High DPI optimizations */
.high-dpi img {
    image-rendering: crisp-edges;
}

/* Touch feedback */
.touch-active {
    transform: scale(0.98);
    opacity: 0.8;
    transition: all 0.1s ease;
}

@media (hover: none) {
    .btn:hover {
        transform: none !important;
        opacity: 1 !important;
    }
    
    .touch-active {
        transform: scale(0.95);
        opacity: 0.9;
    }
}

/* Thumb zone indicators */
.thumb-zone {
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
}

.extended-reach {
    opacity: 0.9;
}

/* Accessibility controls */
.accessibility-controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
    display: flex;
    gap: 5px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.accessibility-controls:hover {
    opacity: 1;
}

.accessibility-controls.persistent {
    opacity: 1 !important;
}

.accessibility-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.accessibility-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* High contrast mode */
.high-contrast {
    filter: contrast(150%) brightness(110%);
}

.high-contrast button,
.high-contrast .btn {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
}

.high-contrast button:hover,
.high-contrast .btn:hover {
    background: #000 !important;
    color: #fff !important;
}

/* Focus mode */
.focus-mode * {
    outline: none;
}

.focus-mode *:focus {
    outline: 3px solid #FFD700 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px rgba(255, 215, 0, 0.3) !important;
}

/* Reduced motion */
.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Performance optimizations */
.low-performance * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
}

.low-performance .particle-effects,
.low-performance .complex-animation {
    display: none !important;
}

/* Power user mode */
.power-user .advanced-controls {
    display: block;
}

.advanced-controls {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.advanced-control {
    margin-bottom: 10px;
}

.advanced-control label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.advanced-control select,
.advanced-control input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Gesture enhanced mode */
.gesture-enhanced .mascot-controls {
    opacity: 0.8;
}

.gesture-enhanced .mascot-controls:hover {
    opacity: 1;
}

/* Context menus */
.mascot-context-menu,
.adaptive-tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.context-option {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.context-option:hover {
    background: rgba(255, 255, 255, 0.2);
}



/* Emergency help modal */
.emergency-help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.emergency-help-modal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.emergency-help-modal h3 {
    margin-bottom: 20px;
    color: #d9534f;
}

.emergency-help-modal button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.emergency-help-modal button:first-of-type {
    background: #d9534f;
    color: white;
}

.emergency-help-modal button:last-of-type {
    background: #6c757d;
    color: white;
}

/* Debug panel */
.debug-panel {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: #0f0;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10000;
    max-width: 300px;
}

.debug-header {
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
}

.debug-info div {
    margin-bottom: 2px;
}

/* Predictive suggestions */
.predictive-suggestions {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background: #f8f9fa;
}

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

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

.keyboard-shortcuts-modal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    margin: 20px;
}

.keyboard-shortcuts-modal h3 {
    margin-bottom: 20px;
    text-align: center;
}

.keyboard-shortcuts-modal ul {
    list-style: none;
    padding: 0;
}

.keyboard-shortcuts-modal li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.keyboard-shortcuts-modal kbd {
    background: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
}

.keyboard-shortcuts-modal .close-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
}

/* Notification animations */
@keyframes slideInRight {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

.adaptive-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.adaptive-notification.info {
    background: #4A90E2;
}

.adaptive-notification.success {
    background: #5CB85C;
}

.adaptive-notification.warning {
    background: #F0AD4E;
}

.adaptive-notification.error {
    background: #D9534F;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute !important;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 6px;
    color: #fff;
    text-decoration: none;
}

/* Memory constrained mode */
.memory-constrained .mascot-controls {
    animation: none !important;
}

.memory-constrained .particle {
    animation-duration: 3s !important;
}

/* Rainbow animation for easter egg */
@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Responsive optimizations for small screens */
@media (max-width: 576px) {
    .accessibility-controls {
        top: 5px;
        right: 5px;
        gap: 3px;
    }
    
    .accessibility-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .ai-suggestions-panel {
        bottom: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: 280px;
    }
    
    .experimental-features {
        bottom: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: 230px;
    }
    
    .debug-panel {
        bottom: 5px;
        left: 5px;
        max-width: calc(100% - 10px);
        font-size: 11px;
    }
    
    .adaptive-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Dark mode support for adaptive features */
[data-theme="dark"] .advanced-controls {
    background: rgba(30, 30, 30, 0.95);
    border-color: #555;
    color: white;
}

[data-theme="dark"] .advanced-control select,
[data-theme="dark"] .advanced-control input {
    background: #333;
    color: white;
    border-color: #555;
}

[data-theme="dark"] .experimental-features {
    background: rgba(30, 30, 30, 0.95);
    border-color: #555;
    color: white;
}

[data-theme="dark"] .keyboard-shortcuts-modal .modal-content {
    background: #1a1a1a;
    color: white;
}

[data-theme="dark"] .keyboard-shortcuts-modal li {
    border-color: #333;
}

[data-theme="dark"] .keyboard-shortcuts-modal kbd {
    background: #333;
    border-color: #555;
    color: white;
}

[data-theme="dark"] .predictive-suggestions {
    background: #1a1a1a;
    border-color: #555;
    color: white;
}

[data-theme="dark"] .suggestion-item {
    border-color: #333;
}

[data-theme="dark"] .suggestion-item:hover,
[data-theme="dark"] .suggestion-item:focus {
    background: #333;
}

/* Live region for screen readers (invisible but accessible) */
#live-announcements {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Offline indicators */
.offline .online-only {
    display: none !important;
}

.offline .offline-available {
    display: block !important;
}

body.offline::before {
    content: "⚠️ Working Offline";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f0ad4e;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 14px;
    z-index: 10000;
}

/* Batch operations support */
.batch-enabled {
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.batch-enabled::after {
    content: "Drop multiple files here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #007bff;
    font-weight: 600;
    pointer-events: none;
}