@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-body: #0f0f0f;
    --bg-sidebar: #161616;
    --bg-surface: #1e1e1e;
    --bg-input: #2a2a2a;
    
    --text-primary: #ffffff;
    --text-secondary: #9aa0a6;
    
    --primary-color: #FFA500;
    --primary-hover: #ffb733;
    
    --border-color: #333;
    
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    
    --font-stack: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Sidebar Toggle */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 200;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

body.sidebar-open .sidebar-overlay {
    display: block;
}

@media (max-width: 1024px) {
    /* Existing mobile styles can remain or be updated */
}

.logo-container {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    max-width: 100px;
    height: auto;
}

.new-chat-btn {
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    transition: background 0.2s;
    margin-bottom: 20px;
    width: 100%;
}

.new-chat-btn:hover {
    background-color: var(--primary-hover);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    text-decoration: none;
}

.history-item .title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    display: flex;
    align-items: center;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.history-item.active {
    background-color: rgba(255, 165, 0, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: opacity 0.2s;
}
.history-item:hover .delete-btn { opacity: 1; }
.delete-btn:hover { color: #ff4444; }

.guest-promo {
    background-color: rgba(255, 165, 0, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
    text-align: center;
}
.guest-promo h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 15px;
}
.guest-promo p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.login-btn-promo {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: #000;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background .2s;
}
.login-btn-promo:hover {
    background: var(--primary-hover);
}


.user-profile {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .2s;
    display: flex;
}
.logout-link:hover {
    color: #ef4444;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar.user { background: #333; color: #fff; }
.avatar.assistant { background: transparent; }


/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(255, 165, 0, 0.03), transparent 60%);
    width: 100%;
    height: 100%;
    padding-top: 60px; /* Space for the toggle button */
}

.chat-header {
    position: absolute;
    top: -60px; /* Inside the main-chat padding area */
    left: 0;
    width: 100%;
    padding: 18px 20px;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 50;
    text-align: center;
    display: none;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}


.chat-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 20px 0 150px 0;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}


.welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}
.welcome-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: #000;
}
.welcome-view h2 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}
.welcome-view p {
    font-size: 16px;
    margin: 0;
}


.message {
    padding: 24px;
    display: flex;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

.message-content {
    display: flex;
    gap: 16px;
    width: 100%;
    line-height: 1.6;
}

.message-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    min-width: 0; /* İçeriğin taşmasını önler */
}

.text {
    font-size: 16px;
    color: var(--text-primary);
    overflow-wrap: break-word;
}

.text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
    transition: all 0.2s;
}

.text a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

/* Table Styles */
.text table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.text th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.text td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.text tr:last-child td {
    border-bottom: none;
}

.text tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.text p { margin-top: 0; }

.text pre {
    background: #1e1e1e;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
    position: relative;
    margin: 1em 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2d2d2d;
    padding: 8px 16px;
    font-size: 12px;
    color: #aaa;
    border-bottom: 1px solid #333;
}

.copy-btn {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #444;
    color: #fff;
}

.text code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
}

.text p code {
    background: #2a2a2a;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffb733;
}

.text pre code {
    display: block;
    padding: 16px;
    overflow-x: auto;
    background: transparent !important;
}

/* Input Area */
.input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, var(--bg-body) 80%, transparent);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 60;
}

.input-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.1);
}

textarea {
    width: 100%;
    background: transparent;
    border: none;
    padding: 16px 50px 16px 16px;
    color: #fff;
    font-size: 16px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 200px;
}

.send-btn {
    position: absolute;
    right: 12px;
    bottom: 8px;
    background: var(--primary-color);
    border: none;
    color: #000;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn svg {
    transform: none;
}

.avatar.assistant.spin-slow img { animation: spin 3s linear infinite; }
.avatar.assistant.spin-fast img { animation: spin 0.8s linear infinite; }

/* Memory Notification */
.memory-toast {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(16, 163, 127, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInUp 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.close-modal {
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover { color: var(--text-primary); }

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.memory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memory-item {
    background: var(--bg-input);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid transparent;
}

.memory-item:hover {
    border-color: var(--border-color);
}

.memory-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    margin-right: 12px;
    color: #ddd;
    white-space: pre-wrap;
}

.memory-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn.edit:hover { color: #FFA500; }
.icon-btn.delete:hover { color: #ff4444; }

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.danger-btn {
    background-color: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid #ff4444;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.danger-btn:hover {
    background-color: #ff4444;
    color: white;
}

.edit-input {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

/* New Buttons */
.secondary-btn {
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.secondary-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.primary-btn-sm {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.secondary-btn-sm {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 5px;
}

.danger-btn-outline {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.danger-btn-outline:hover {
    background: rgba(255, 68, 68, 0.1);
}

@media (max-width: 768px) {
    .chat-container { padding: 60px 16px 120px 16px; }
    .message { padding: 16px 10px; }
    .input-container { margin: 0 10px; }
}

/* Modern Research UI */
.research-section {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.research-query {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Wireframe Loading Animation */
.wireframe-loader {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.wire-line {
    height: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Favicon Bar */
.favicon-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.source-pill {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 32px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.source-pill:hover, .source-pill.expanded {
    max-width: 200px;
    padding-right: 12px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.source-pill img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    flex-shrink: 0;
}

.source-pill span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
}

.source-pill:hover span, .source-pill.expanded span {
    opacity: 1;
}

.research-status {
    font-size: 11px;
    color: var(--primary-color);
    margin-top: 8px;
    opacity: 0.8;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.server-item {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.server-info strong {
    display: block;
    color: #fff;
    margin-bottom: 2px;
}
.server-info span {
    color: #888;
    font-size: 0.85em;
    font-family: monospace;
}
.server-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.form-group {
    margin-bottom: 12px;
}
.form-row {
    display: flex;
    gap: 10px;
}
.form-input {
    width: 100%;
    background: #222;
    border: 1px solid #444;
    color: #eee;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 14px;
}
.form-input:focus {
    border-color: #555;
    outline: none;
}
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #333;
    color: #aaa;
}
.badge.monitor_only { color: #64b5f6; background: rgba(33, 150, 243, 0.15); }
.badge.approval_required { color: #ffb74d; background: rgba(255, 152, 0, 0.15); }
.badge.auto_fix { color: #81c784; background: rgba(76, 175, 80, 0.15); }

/* Crawdbot Terminal Styles */
.crawdbot-terminal {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #333;
}
.crawdbot-terminal .log-line {
    white-space: pre-wrap;
    margin-bottom: 2px;
    line-height: 1.3;
}
/* Scrollbar for terminal */
.crawdbot-terminal::-webkit-scrollbar {
    width: 6px;
}
.crawdbot-terminal::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
.crawdbot-terminal::-webkit-scrollbar-track {
    background: #111;
}

/* --- INTEGRATED MODERN PLAN CARD STYLES --- */
/* Adapted for Dark Theme */
.plan-card-integrated.modern {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    color: #fff;
}

.plan-header-modern {
    background: #222;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 15px;
}

.plan-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 165, 0, 0.1);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.plan-subtitle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    margin-bottom: 2px;
}

.plan-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.plan-body-modern {
    padding: 10px;
    background: #1a1a1a;
}

.plan-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.2s;
    margin-bottom: 4px;
}

.plan-step-item:hover {
    background: #252525;
    border-color: #333;
}

.step-drag-handle {
    color: #555;
    cursor: grab;
    font-size: 14px;
    user-select: none;
}

.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-desc-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #eee;
    padding: 2px 0;
    outline: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.step-desc-input:focus {
    border-bottom-color: var(--primary-color);
}

.step-meta {
    font-size: 11px;
    color: #777;
}

.step-actions {
    opacity: 0;
    transition: opacity 0.2s;
}

.plan-step-item:hover .step-actions {
    opacity: 1;
}

.icon-btn-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #777;
    transition: all 0.2s;
}

.icon-btn-sm:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.plan-footer-modern {
    padding: 12px 20px;
    border-top: 1px solid #333;
    background: #222;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel-modern {
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-modern:hover {
    background: #333;
    color: #fff;
}

.btn-start-modern {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #000;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-start-modern:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.2);
}

/* Running State Styles - Adapting to Dark Theme */
.plan-step {
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #1e1e1e;
    overflow: hidden;
}

.step-main {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.step-main:hover {
    background: #2a2a2a;
}

.step-status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444; /* Pending */
    transition: all 0.3s;
}

.plan-step.running .step-status-icon {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.2);
}

.plan-step.completed .step-status-icon {
    background: #10b981;
}

.plan-step.failed .step-status-icon {
    background: #ef4444;
}

.step-desc {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #eee;
}

.step-expander {
    font-size: 10px;
    color: #777;
    transition: transform 0.2s;
}

.plan-step.expanded .step-expander {
    transform: rotate(180deg);
}

.step-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #111;
}

.plan-step.expanded .step-details {
    max-height: 300px;
}

.step-terminal {
    padding: 15px;
    color: #0f0;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 300px;
}

.step-terminal::-webkit-scrollbar {
    width: 6px;
}

.step-terminal::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* --- SEARCH LOADING & UI --- */

/* Container for search widget */
.search-widget {
    margin-bottom: 20px;
    padding: 10px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.5s ease;
}

/* Shimmering Text Effect */
.search-loading-text {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(to right, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.3) 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerText 3s linear infinite;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes shimmerText {
    to {
        background-position: 200% center;
    }
}

/* Container for Favicons */
.search-sources-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 5px;
}

/* Individual Source Item (Favicon + Tooltip) */
.source-favicon-item {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.source-favicon-item:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    z-index: 10;
}

.source-favicon-item img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

/* Tooltip for Source Title */
.source-favicon-item::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-favicon-item:hover::after {
    opacity: 1;
}

/* Fade out loading text when done */
.search-widget.loaded .search-loading-text {
    display: none;
}
