/* ============================================
   COMPLETE STYLE.CSS REPLACEMENT
   WITH MAXIMUM WIDTH AI CHAT
   ============================================ */

/* General Body & Layout */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #2d3748; line-height: 1.6; font-size: 16px; padding: 20px;
    transition: background 0.5s, color 0.5s;
}
body.dark-mode {
    background: #1a202c;
    color: #e2e8f0;
}
body.dyslexia-mode {
    font-family: 'OpenDyslexic', 'Lexend', sans-serif;
}

/* ============================================
   SUPER WIDE CONTAINER - MAXIMUM SPACE
   ============================================ */
.container {
    max-width: 95vw !important; /* Use 95% of screen width */
    width: 95vw !important;
    margin: 80px auto 0 !important; 
    display: grid !important;
    grid-template-columns: minmax(500px, 600px) 1fr !important; /* Left: max 600px, Right: ALL remaining space */
    gap: 40px !important; 
    align-items: start !important;
}

/* On smaller screens, stack vertically */
@media (max-width: 1400px) {
    .container {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
        padding: 0 20px !important;
    }
}

.feedback-container { display: block; max-width: 700px; }

/* Cards */
.card {
    background: white; border-radius: 12px; padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.dark-mode .card { background: #2d3748; }

/* Header */
.header {
    grid-column: 1 / -1; text-align: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white; margin-bottom: 20px; padding: 30px;
}
.header h1 { font-size: 2.5rem; margin-bottom: 10px; }
.header p { font-size: 1.2rem; opacity: 0.9; }

/* Forms & Inputs */
textarea, input, select {
    width: 100%; padding: 12px; border: 2px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; margin: 8px 0;
    background: #f8fafc; transition: all 0.3s ease;
}
.dark-mode textarea, .dark-mode input, .dark-mode select {
    background: #1a202c; border-color: #4a5568; color: #e2e8f0;
}
textarea:focus, input:focus, select:focus {
    outline: none; border-color: #4facfe;
}
textarea { min-height: 150px; font-family: 'Consolas', 'Monaco', monospace; }
.form-group { margin-bottom: 20px; }
label { display: block; font-weight: 600; margin-bottom: 8px; }

/* Navigation & Buttons */
.main-navbar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 6px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-btn {
    padding: 6px 12px; border: 1px solid #e2e8f0;
    border-radius: 15px; background: white; color: #2d3748;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
}
.nav-btn.active { background: #4facfe; color: white; border-color: #4facfe; }
.buttons-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 20px;
}
.clean-btn {
    padding: 12px 15px; border: none; border-radius: 8px;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
    position: relative;
    overflow: hidden;
}

/* Shine effect for all buttons */
.clean-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.clean-btn:hover::before {
    left: 100%;
}

.clean-btn:disabled { cursor: not-allowed; background-color: #e2e8f0; color: #a0aec0; transform: none; box-shadow: none; }  

.clean-btn.primary { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.clean-btn.secondary { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #2d3748; }
.clean-btn.security { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); color: #2d3748; }
.clean-btn.test { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); color: #2d3748; }
.clean-btn.advanced { background: linear-gradient(135deg, #ffd89b 0%, #fcbf95 100%); color: #2d3748; }
.clean-btn.course { background: linear-gradient(135deg, #b7f8db 0%, #96e6b3 100%); color: #2d3748; }
.clean-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Results & Feedback */
.results {
    min-height: 300px; max-height: 500px; overflow-y: auto; padding: 15px;
    background: #f8fafc; border-radius: 8px; white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; line-height: 1.8;
}
.dark-mode .results { background: #1a202c; }
.loading {
    display: inline-block; width: 20px; height: 20px; border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.back-link { text-align: center; margin-top: 20px; }
.back-link a { color: #4facfe; text-decoration: none; font-weight: 600; }
.subtitle { text-align: center; color: #666; margin-bottom: 30px; }

/* Zen Mode */
body.zen-mode .header,
body.zen-mode .card:first-of-type h3,
body.zen-mode #moodInput,
body.zen-mode .buttons-grid {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.zen-mode .container {
    margin-top: 80px;
    grid-template-columns: minmax(500px, 600px) 1fr;
}

body {
    transition: background 0.5s, color 0.5s, font-size 0.3s ease;
}

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

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #4facfe;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    top: 0;
}

/* Template buttons */
.code-templates {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.template-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}
.dark-mode .template-btn {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}
.template-btn:hover {
    background: #f0f9ff;
    border-color: #4facfe;
}
.dark-mode .template-btn:hover {
    background: #4a5568;
}

/* Results header with actions */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.result-actions {
    display: flex;
    gap: 8px;
}
.mini-btn {
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}
.dark-mode .mini-btn {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}
.mini-btn:hover {
    background: #e2e8f0;
}
.dark-mode .mini-btn:hover {
    background: #4a5568;
}

/* High Contrast mode */
.high-contrast {
    filter: contrast(2) !important;
}
.high-contrast * {
    border-width: 2px !important;
}

/* Focus Assist mode */
.focus-assist .card:not(:focus-within) {
    opacity: 0.6;
    filter: blur(1px);
    transition: all 0.3s ease;
}
.focus-assist .card:focus-within {
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.5);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Help text */
.help-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #718096;
    font-style: italic;
}
.dark-mode .help-text {
    color: #a0aec0;
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #718096;
}
.dark-mode .app-footer {
    color: #a0aec0;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Noscript warning */
.noscript-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff4444;
    color: white;
    text-align: center;
    padding: 15px;
    font-weight: 600;
    z-index: 100000;
}


/* ============================================
   CHAT STYLES - MAXIMUM WIDTH
   ============================================ */

.chat-card {
    margin-top: 20px;
    width: 100% !important;
    max-width: 100% !important;
}

.chat-history {
    height: 650px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    padding: 25px !important;
    margin-bottom: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 20px 25px !important;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
}

.chat-message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: 5% !important;
    margin-right: 0 !important;
}

.chat-message.assistant {
    background: white;
    border: 1px solid #e2e8f0;
    margin-left: 0 !important;
    margin-right: 2% !important;
}

.message-header {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.message-content {
    line-height: 1.7;
    font-size: 15px;
    width: 100% !important;
    max-width: 100% !important;
}

/* Better code blocks in messages */
.message-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 25px !important;
    border-radius: 8px;
    margin: 20px 0 !important;
    overflow-x: auto;
    border-left: 4px solid #10b981;
    width: 100% !important;
    max-width: 100% !important;
}

.message-content code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Inline code in text */
.message-content p code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e11d48;
    font-size: 0.9em;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.typing .message-content::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Dark mode support for chat */
.dark-mode .chat-history {
    background: #1a202c;
    border-color: #4a5568;
}

.dark-mode .chat-message.assistant {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

.dark-mode .message-content p code {
    background: #1a202c;
    color: #f87171;
}


/* ============================================
   AI ASSISTANT - MAXIMUM WIDTH POSSIBLE
   ============================================ */

/* AI chat panel - TAKE ALL AVAILABLE SPACE */
.ai-assistant-panel,
.ai-chat-container,
.chat-panel {
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* AI messages - FULL width */
.ai-message {
    max-width: 100% !important;
    width: 100% !important;
    padding: 25px !important;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* AI code blocks - MAXIMUM width */
.ai-message pre {
    padding: 25px !important;
    border-left: 4px solid #10b981;
    background: #1e293b !important;
    border-radius: 8px;
    margin: 20px 0 !important;
    overflow-x: auto;
    width: 100% !important;
    max-width: 100% !important;
}

.ai-message code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
}

/* Inline code in AI messages */
.ai-message p code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    color: #e11d48;
    font-size: 0.9em;
}

/* Dark mode inline code */
.dark-mode .ai-message p code {
    background: #1a202c;
    color: #f87171;
}

/* Better step headers in AI responses */
.ai-message strong {
    color: #6366f1;
    font-size: 17px;
    font-weight: 600;
    display: inline-block;
    margin-top: 15px;
}

/* Better paragraphs in AI responses */
.ai-message p {
    margin-bottom: 15px;
    color: #334155;
    font-size: 15px;
    line-height: 1.8;
}

.dark-mode .ai-message p {
    color: #e2e8f0;
}

/* Emoji styling */
.ai-message .emoji,
.message-content .emoji {
    font-size: 1.4em;
    margin-right: 5px;
}

/* Better scrollbar for chat */
.chat-history::-webkit-scrollbar {
    width: 12px;
}

.chat-history::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* ============================================
   RESPONSIVE - Mobile & Tablet
   ============================================ */

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr !important;
    }
    
    .ai-assistant-panel,
    .ai-chat-container,
    .chat-panel {
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 900px) {
    .chat-message.user {
        margin-left: 0 !important;
    }
    
    .chat-message.assistant {
        margin-right: 0 !important;
    }
    
    .chat-history {
        height: 400px !important;
        padding: 15px !important;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .container {
        gap: 15px !important;
    }
    
    .card {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .ai-message,
    .chat-message {
        padding: 15px !important;
    }
    
    .ai-message pre,
    .message-content pre {
        padding: 15px !important;
        font-size: 12px;
    }
     /* ============================================
   NAVBAR RESPONSIVE - FORCE WRAP BUTTONS
   ============================================ */

@media (max-width: 768px) {
    /* Force navbar to be taller and flexible */
    nav {
        height: auto !important;
        min-height: 60px !important;
        padding: 10px 15px !important;
    }
    
    /* Force buttons container to WRAP */
    nav > div[style*="display: flex"][style*="gap: 8px"] {
        flex-wrap: wrap !important;
        width: 100% !important;
        justify-content: center !important;
        gap: 6px !important;
        max-width: 100% !important;
    }
    
    /* Make buttons smaller */
    nav button {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }
    
    nav button img {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Hide logo subtitle on mobile */
    nav > div:first-child > div > span:last-child {
        display: none !important;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 8px 10px !important;
    }
    
    nav > div[style*="display: flex"][style*="gap: 8px"] {
        gap: 4px !important;
        padding: 6px !important;
    }
    
    nav button {
        width: 36px !important;
        height: 36px !important;
    }
    
    nav button img {
        width: 18px !important;
        height: 18px !important;
    }
}
        
/* Mobile navbar - simple wrap */
@media (max-width: 768px) {
    nav > div:last-child {
        flex-wrap: wrap !important;
    }
}

/* Visible border on left card */
.container > section:first-of-type {
    border: 3px solid #667eea !important;
}  
    

/* Clean formatted AI responses */
#results, .chat-bubble, .results {
    white-space: pre-line;
    line-height: 1.8;
    font-size: 15px;
}

#results h4, .chat-bubble h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #667eea;
}

#results ul, .chat-bubble ul {
    margin: 10px 0 10px 20px;
    line-height: 1.6;
}

#results li, .chat-bubble li {
    margin-bottom: 8px;
}

#results code, .chat-bubble code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}
