/* ========================================
   Auto Claude - Base Styles
   Premium UX - iOS 17 Design Language
   ======================================== */

/* ==========================================
   CSS RESET
   ----------------------------------------
   Modern CSS reset with sensible defaults
   ========================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', var(--font-system);
    font-size: var(--text-body-sm);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--surface-primary);
}

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

/* ==========================================
   GLOBAL FOCUS STATES
   ----------------------------------------
   Accessible focus rings for keyboard nav
   ========================================== */

/* Remove default focus outline */
*:focus {
    outline: none;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Custom focus ring for buttons */
button:focus-visible,
.btn-circle:focus-visible,
.toggle-pill:focus-visible,
.segment-btn:focus-visible,
.quick-action-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px var(--surface-primary),
        0 0 0 5px var(--color-primary);
}

/* Focus ring for inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow:
        0 0 0 3px var(--color-primary-muted),
        inset 0 0 0 1px var(--color-primary);
}

/* ==========================================
   GLOBAL MICRO-INTERACTIONS
   ----------------------------------------
   Subtle animations for premium feel
   ========================================== */

/* Smooth transitions for interactive elements */
button,
a,
input,
textarea,
select,
.toggle-pill,
.segment-btn,
.quick-action-btn,
.stat-card,
.log-item,
.history-item {
    transition: all var(--transition-fast);
}

/* Active press effect for all buttons */
button:active:not(:disabled),
.toggle-pill:active,
.segment-btn:active,
.quick-action-btn:active {
    transform: scale(0.97);
    transition-duration: var(--duration-instant);
}

/* Disable animations for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   APP CONTAINER
   ----------------------------------------
   Main layout structure
   ========================================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        var(--surface-secondary) 0%,
        var(--surface-primary) 100%
    );
}

/* ==========================================
   APP HEADER
   ----------------------------------------
   Minimal top bar with status
   Premium iOS 17 style header
   ========================================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(
        180deg,
        rgba(44, 44, 46, 0.95) 0%,
        rgba(44, 44, 46, 0.85) 100%
    );
    backdrop-filter: blur(var(--blur-3xl));
    -webkit-backdrop-filter: blur(var(--blur-3xl));
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    position: relative;
    z-index: var(--z-sticky);
}

/* Subtle gradient overlay for depth */
.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--glass-border-light) 50%,
        transparent 100%
    );
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* App Logo */
.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    font-size: var(--text-h3);
    color: var(--color-primary);
    filter: drop-shadow(0 0 12px rgba(10, 132, 255, 0.6));
    animation: pulse 3s infinite var(--ease-in-out);
}

.logo-icon i {
    display: block;
}

.app-title {
    font-size: var(--text-h4);
    font-weight: var(--weight-bold);
    background: linear-gradient(
        135deg,
        var(--text-primary) 0%,
        var(--color-primary) 50%,
        var(--text-primary) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: var(--tracking-tight);
    margin: 0;
}

/* Status Indicator - Premium chip design */
.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background: var(--glass-bg-dark);
    border: 1px solid var(--border-tertiary);
    border-radius: var(--radius-pill);
    transition: all var(--transition-fast);
}

.status-indicator:hover {
    background: var(--fill-secondary);
    border-color: var(--border-secondary);
}

/* Clickable status - tiklayinca calisan task'i acar */
.status-indicator.clickable {
    cursor: pointer;
}

.status-indicator.clickable:active {
    transform: scale(0.97);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-success);
    transition: all var(--transition-fast);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.running {
    background: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary);
    animation: pulse 1.5s infinite var(--ease-in-out);
}

.status-dot.success {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.error {
    background: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}

.status-dot.paused {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

.status-label {
    font-size: var(--text-caption);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.status-indicator:hover .status-label {
    color: var(--text-primary);
}

/* Header Button */
.header-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--fill-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-btn:hover {
    background: var(--fill-secondary);
    color: var(--text-primary);
}

.header-btn i {
    font-size: 14px;
}

/* ==========================================
   CONTROL PANEL
   ----------------------------------------
   Model selector and toggles
   ========================================== */

.control-panel {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--glass-bg-dark);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border-bottom: 1px solid var(--border-tertiary);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* iOS Segmented Control - Premium Design */
.model-segment-control {
    display: flex;
    background: var(--glass-bg-dark);
    border: 1px solid var(--border-tertiary);
    border-radius: var(--radius-xl);
    padding: 3px;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

/* Floating indicator effect */
.model-segment-control::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(33.33% - 4px);
    height: calc(100% - 6px);
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-spring);
    z-index: 0;
    pointer-events: none;
}

.model-segment-control.sonnet::before {
    transform: translateX(100%);
}

.model-segment-control.haiku::before {
    transform: translateX(200%);
}

.segment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-tertiary);
    font-size: var(--text-caption);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: color var(--transition-fast);
    min-width: auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.segment-btn:hover {
    color: var(--text-secondary);
}

.segment-btn.active {
    color: var(--text-primary);
}

.segment-icon {
    font-size: var(--text-label);
    transition: transform var(--transition-spring);
}

.segment-btn:hover .segment-icon {
    transform: scale(1.1);
}

.segment-btn.active .segment-icon {
    transform: scale(1.15);
}

.segment-label {
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-tight);
}

/* Toggle Pills - Premium Design */
.toggle-pills-group {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.toggle-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--glass-bg-dark);
    border: 1px solid var(--border-tertiary);
    border-radius: var(--radius-pill);
    color: var(--text-tertiary);
    font-size: var(--text-caption);
    cursor: pointer;
    transition: all var(--transition-spring);
    min-width: auto;
    position: relative;
    overflow: hidden;
}

/* Subtle shine effect */
.toggle-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    transition: left var(--duration-slow) var(--ease-out);
}

.toggle-pill:hover::before {
    left: 100%;
}

.toggle-pill:hover {
    background: var(--fill-secondary);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
}

.toggle-pill:active {
    transform: translateY(0) scale(0.98);
}

.toggle-pill.active {
    background: linear-gradient(
        135deg,
        var(--color-success-subtle) 0%,
        rgba(48, 209, 88, 0.12) 100%
    );
    border-color: var(--color-success-muted);
    color: var(--color-success);
    box-shadow: 0 0 20px var(--color-success-subtle);
}

.toggle-pill.active .pill-status {
    color: var(--color-success);
}

.pill-icon {
    font-size: var(--text-body-sm);
    transition: transform var(--transition-spring);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-icon i {
    display: block;
}

.toggle-pill:hover .pill-icon {
    transform: scale(1.1);
}

.toggle-pill.active .pill-icon {
    animation: bounce 0.5s var(--ease-spring) forwards;
}

.pill-label {
    font-weight: var(--weight-medium);
    transition: color var(--transition-fast);
}

.pill-status {
    font-size: var(--text-micro);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    padding: 2px var(--space-2);
    background: var(--fill-tertiary);
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.toggle-pill.active .pill-status {
    background: var(--color-success-muted);
}

/* ==========================================
   STATUS BAR
   ----------------------------------------
   Compact inline status indicators
   ========================================== */

.status-bar {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    flex-shrink: 0;
}

.status-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--fill-quaternary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.status-item.clickable {
    cursor: pointer;
}

.status-item.clickable:hover {
    background: var(--fill-tertiary);
}

.status-item-label {
    font-size: var(--text-micro);
    font-weight: var(--weight-semibold);
    color: var(--text-quaternary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    white-space: nowrap;
}

.status-item-bar {
    flex: 1;
    height: 4px;
    background: var(--fill-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    min-width: 40px;
}

.status-item-fill {
    height: 100%;
    background: var(--color-success);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
}

.status-item-bar.primary .status-item-fill {
    background: var(--color-primary);
}

.status-item-value {
    font-size: var(--text-caption);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status-item-value.normal {
    color: var(--color-success);
}

.status-item-value.warning {
    color: var(--color-warning);
}

.status-item-value.critical {
    color: var(--color-danger);
}

.status-item-arrow {
    font-size: 10px;
    color: var(--text-quaternary);
    margin-left: var(--space-1);
}

/* Legacy status dashboard support */
.status-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    flex-shrink: 0;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    transition: all var(--transition-spring);
    position: relative;
    overflow: hidden;
}

/* Glassmorphism shine effect */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--glass-gradient);
    pointer-events: none;
}

.stat-card:hover {
    background: var(--glass-bg-light);
    border-color: var(--glass-border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:active {
    transform: translateY(0);
}

/* Context card specific styling */
.stat-card.context-card {
    background: linear-gradient(
        135deg,
        var(--glass-bg) 0%,
        rgba(48, 209, 88, 0.03) 100%
    );
}

/* Progress card specific styling */
.stat-card.progress-card {
    background: linear-gradient(
        135deg,
        var(--glass-bg) 0%,
        rgba(10, 132, 255, 0.03) 100%
    );
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    position: relative;
    z-index: 1;
}

.stat-icon {
    font-size: var(--text-body);
    color: var(--text-secondary);
}

.stat-icon i {
    display: block;
}

.stat-title {
    font-size: var(--text-caption);
    font-weight: var(--weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.stat-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    position: relative;
    z-index: 1;
}

.stat-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.stat-value {
    font-size: var(--text-h3);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    transition: color var(--transition-fast);
}

.stat-value.normal {
    color: var(--color-success);
    text-shadow: 0 0 20px var(--color-success-muted);
}

.stat-value.warning {
    color: var(--color-warning);
    text-shadow: 0 0 20px var(--color-warning-muted);
}

.stat-value.critical {
    color: var(--color-danger);
    text-shadow: 0 0 20px var(--color-danger-muted);
    animation: pulse 1s infinite;
}

.stat-detail {
    font-size: var(--text-caption);
    color: var(--text-quaternary);
    font-variant-numeric: tabular-nums;
}

.phase-badge {
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(
        135deg,
        var(--color-primary-muted) 0%,
        var(--color-primary-subtle) 100%
    );
    border: 1px solid var(--color-primary-muted);
    border-radius: var(--radius-pill);
    color: var(--color-primary);
    font-weight: var(--weight-semibold);
    font-size: var(--text-caption);
    transition: all var(--transition-fast);
}

.phase-badge:hover {
    background: var(--color-primary-muted);
    transform: scale(1.02);
}

/* Progress Bars - Premium Design */
.stat-progress-bar {
    height: 6px;
    background: var(--fill-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

/* Animated background pattern */
.stat-progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

.stat-progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-success) 0%,
        var(--color-success-hover) 100%
    );
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-spring),
                background var(--transition-slow);
    position: relative;
    overflow: hidden;
}

/* Shine animation on progress bar */
.stat-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

.stat-progress-bar.primary .stat-progress-fill {
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        var(--color-primary-hover) 100%
    );
}

.stat-progress-fill.warning {
    background: linear-gradient(
        90deg,
        var(--color-warning) 0%,
        var(--color-warning-hover) 100%
    );
}

.stat-progress-fill.critical {
    background: linear-gradient(
        90deg,
        var(--color-danger) 0%,
        var(--color-danger-hover) 100%
    );
    animation: pulse 1s infinite;
}

/* ==========================================
   QUICK ACTIONS BAR
   ----------------------------------------
   Tool buttons row - Premium design
   ========================================== */

.quick-actions-bar {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4) var(--space-4);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    justify-content: center;
}

.quick-actions-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    min-width: 72px;
    min-height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    color: var(--text-secondary);
    font-size: var(--text-caption);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: all var(--transition-spring);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    flex: 1;
    max-width: 100px;
}

/* Glassmorphism shine effect */
.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--glass-gradient);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.quick-action-btn:hover::before {
    opacity: 1;
}

.quick-action-btn:hover {
    background: var(--glass-bg-light);
    border-color: var(--color-primary-muted);
    color: var(--text-primary);
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(10, 132, 255, 0.2),
        0 0 0 1px var(--color-primary-muted);
}

.quick-action-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.action-icon {
    font-size: 22px;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-spring);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.action-icon i {
    display: block;
}

.quick-action-btn:hover .action-icon {
    transform: scale(1.2);
}

.action-label {
    font-size: var(--text-micro);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    position: relative;
    z-index: 1;
}

.action-indicator {
    font-size: var(--text-micro);
    opacity: 0.5;
    transition: transform var(--transition-spring), opacity var(--transition-fast);
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
}

.quick-action-btn:hover .action-indicator {
    opacity: 1;
}

.action-indicator.open {
    transform: rotate(180deg);
}

/* ==========================================
   REPO PANEL
   ----------------------------------------
   Collapsible repository panel
   ========================================== */

.repo-panel-container {
    padding: 0 var(--space-4) var(--space-3);
    flex-shrink: 0;
}

.repo-panel-content {
    background: var(--glass-bg-dark);
    border: 1px solid var(--border-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
}

.repo-info {
    margin-bottom: var(--space-2);
}

.repo-status-text {
    font-size: var(--text-caption);
    color: var(--text-tertiary);
}

.repo-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ==========================================
   NOTIFICATION AREA
   ----------------------------------------
   Banners for alerts
   ========================================== */

.notification-area {
    padding: 0 var(--space-4);
    flex-shrink: 0;
}

.notification-banner {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    animation: fadeInDown var(--duration-normal) var(--ease-out);
}

.notification-banner.show {
    display: flex;
}

.notification-banner.success {
    background: var(--color-success-subtle);
    border: 1px solid var(--color-success-muted);
    color: var(--color-success);
}

.notification-banner.warning {
    background: var(--color-warning-subtle);
    border: 1px solid var(--color-warning-muted);
    color: var(--color-warning);
}

.notification-icon {
    font-size: var(--text-h4);
}

.notification-icon i {
    display: block;
}

.notification-text {
    font-size: var(--text-body-xs);
    font-weight: var(--weight-medium);
}

/* ==========================================
   OUTPUT MAIN SECTION
   ----------------------------------------
   Main content area - Premium design
   ========================================== */

.output-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 var(--space-4);
    overflow: hidden;
}

.output-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    flex-shrink: 0;
}

.output-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.output-icon {
    font-size: var(--text-label);
    color: var(--text-tertiary);
}

.output-icon i {
    display: block;
}

.output-title {
    font-size: var(--text-caption);
    font-weight: var(--weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

/* Output Container - Premium Design */
.output-container {
    flex: 1;
    background: linear-gradient(
        135deg,
        rgba(18, 18, 20, 0.95) 0%,
        rgba(28, 28, 30, 0.9) 100%
    );
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    overflow-y: auto;
    font-family: 'JetBrains Mono', var(--font-mono);
    font-size: var(--text-body-xs);
    line-height: var(--leading-relaxed);
    white-space: pre-wrap;
    word-wrap: break-word;
    scroll-behavior: smooth;
    position: relative;
}

/* Inner shadow for depth */
.output-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-2xl);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Subtle grid pattern */
.output-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px
    );
    background-size: 100% 24px;
    pointer-events: none;
    opacity: 0.5;
}

/* Premium Scrollbar */
.output-container::-webkit-scrollbar {
    width: 8px;
}

.output-container::-webkit-scrollbar-track {
    background: transparent;
    margin: var(--space-2);
}

.output-container::-webkit-scrollbar-thumb {
    background: var(--fill-secondary);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.output-container::-webkit-scrollbar-thumb:hover {
    background: var(--fill-primary);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Empty State - Premium Design */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-align: center;
    animation: fadeIn var(--duration-slow) var(--ease-out);
    position: relative;
    z-index: 1;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-5);
    opacity: 0.4;
    animation: bounce 3s infinite var(--ease-in-out);
    color: var(--text-tertiary);
}

.empty-state-icon i {
    display: block;
}

.empty-state-title {
    font-size: var(--text-body);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    font-family: 'Inter', var(--font-system);
}

.empty-state-description {
    font-size: var(--text-caption);
    color: var(--text-quaternary);
    max-width: 280px;
    line-height: var(--leading-relaxed);
    font-family: 'Inter', var(--font-system);
}

/* ==========================================
   OUTPUT LINES
   ----------------------------------------
   Different message types styling
   Premium chat-like design
   ========================================== */

.output-line {
    display: block;
    padding: 1px 0;
    color: var(--text-secondary);
    animation: fadeInUp var(--duration-fast) var(--ease-out);
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

/* Assistant text bubble - iOS Messages style */
.output-line.assistant-text {
    color: var(--text-primary);
    padding: var(--space-2) var(--space-3);
    background: linear-gradient(
        135deg,
        var(--surface-quaternary) 0%,
        rgba(58, 58, 60, 0.8) 100%
    );
    border: 1px solid var(--border-tertiary);
    border-radius: var(--radius-2xl) var(--radius-2xl) var(--radius-2xl) var(--radius-sm);
    margin: var(--space-1) 0;
    margin-right: 10%;
    font-size: var(--text-body-xs);
    line-height: 1.4;
    font-family: 'Inter', var(--font-system);
    box-shadow: var(--shadow-xs);
}

/* Tool use indicator - Premium chip design */
.output-line.tool-use {
    color: var(--color-primary);
    padding: var(--space-1) var(--space-2);
    background: linear-gradient(
        135deg,
        var(--color-primary-subtle) 0%,
        rgba(10, 132, 255, 0.08) 100%
    );
    border: 1px solid var(--color-primary-muted);
    border-radius: var(--radius-lg);
    margin: 2px 0;
    font-size: var(--text-caption);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    transition: all var(--transition-fast);
}

.output-line.tool-use:hover {
    background: var(--color-primary-muted);
    transform: translateX(4px);
}

.output-line.tool-use::before {
    content: '▸';
    font-size: var(--text-micro);
    animation: bounce 1s infinite;
}

/* Tool result */
.output-line.tool-result {
    color: var(--text-tertiary);
    padding: var(--space-1) var(--space-2);
    margin-left: var(--space-3);
    margin-top: 1px;
    margin-bottom: 1px;
    font-size: var(--text-caption);
    border-left: 2px solid var(--color-success);
    background: var(--color-success-subtle);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* System message - Warning style */
.output-line.system {
    color: var(--color-warning);
    padding: var(--space-2) var(--space-3);
    background: linear-gradient(
        135deg,
        var(--color-warning-subtle) 0%,
        rgba(255, 159, 10, 0.08) 100%
    );
    border: 1px solid var(--color-warning-muted);
    border-radius: var(--radius-lg);
    margin: var(--space-2) 0;
    font-size: var(--text-caption);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* Phase complete - Celebration style */
.output-line.phase-complete {
    color: var(--color-success);
    font-weight: var(--weight-bold);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(
        135deg,
        var(--color-success-subtle) 0%,
        rgba(48, 209, 88, 0.15) 100%
    );
    border: 1px solid var(--color-success-muted);
    border-radius: var(--radius-2xl);
    margin: var(--space-4) 0;
    text-align: center;
    font-size: var(--text-body-sm);
    box-shadow: 0 0 24px var(--color-success-subtle);
    animation: scaleIn var(--duration-normal) var(--ease-spring);
}

/* Error message - Critical style */
.output-line.error,
.output-container .error {
    color: var(--color-danger);
    background: linear-gradient(
        135deg,
        var(--color-danger-subtle) 0%,
        rgba(255, 69, 58, 0.08) 100%
    );
    border: 1px solid var(--color-danger-muted);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    margin: var(--space-2) 0;
}

/* Inline code - Premium monospace */
.output-line code,
.output-container code {
    background: var(--fill-secondary);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-caption);
    color: var(--color-warning);
    font-family: 'JetBrains Mono', var(--font-mono);
    border: 1px solid var(--border-tertiary);
}

/* ==========================================
   CHAT FOOTER
   ----------------------------------------
   Minimal input with inline buttons
   ========================================== */

.chat-footer {
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    background: var(--surface-primary);
    position: relative;
    z-index: 200; /* Expanded kartın üstünde (z-index: 100) */
}

.chat-input-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--surface-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-3xl);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    transition: all var(--transition-fast);
}

.chat-input-inline:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.chat-input {
    flex: 1;
    min-height: 40px;
    max-height: 100px;
    padding: var(--space-2) 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    font-family: 'Inter', var(--font-system);
    font-size: var(--text-body-sm);
    line-height: var(--leading-normal);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-track {
    background: transparent;
}

.chat-input::-webkit-scrollbar-thumb {
    background: var(--fill-secondary);
    border-radius: 2px;
}

.chat-input:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.chat-input::placeholder {
    color: var(--text-quaternary);
}

.chat-input-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.input-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.input-btn i {
    font-size: 14px;
    color: white;
}

.input-btn-primary {
    background: var(--color-primary);
}

.input-btn-primary:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.input-btn-primary.running {
    background: var(--color-danger);
}

.input-btn-warning {
    background: var(--color-warning);
}

.input-btn-warning:hover {
    background: var(--color-warning-hover);
    transform: scale(1.05);
}

.input-btn-success {
    background: var(--color-success);
}

.input-btn-success:hover {
    background: var(--color-success-hover);
    transform: scale(1.05);
}

.input-btn:active {
    transform: scale(0.95);
}

/* Legacy compatibility */
.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: var(--glass-bg-dark);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-3xl);
    padding: var(--space-2) var(--space-4);
    transition: all var(--transition-spring);
    position: relative;
    overflow: hidden;
}

/* Inner glow effect */
.input-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02) 0%,
        transparent 50%
    );
    pointer-events: none;
}

.input-wrapper:focus-within {
    border-color: var(--color-primary);
    background: rgba(10, 132, 255, 0.05);
    box-shadow:
        0 0 0 3px var(--color-primary-muted),
        0 0 24px rgba(10, 132, 255, 0.2);
}

.chat-textarea {
    flex: 1;
    min-height: 24px;
    max-height: 150px;
    padding: var(--space-2) 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    resize: none;
    font-family: 'Inter', var(--font-system);
    font-size: var(--text-body-sm);
    line-height: var(--leading-snug);
    overflow-y: hidden;
    position: relative;
    z-index: 1;
}

.chat-textarea:focus {
    outline: none;
}

.chat-textarea::placeholder {
    color: var(--text-quaternary);
    transition: color var(--transition-fast);
}

.input-wrapper:focus-within .chat-textarea::placeholder {
    color: var(--text-tertiary);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    z-index: 1;
}

.char-count {
    font-size: var(--text-micro);
    color: var(--text-quaternary);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
    padding: var(--space-1) var(--space-2);
    background: var(--fill-tertiary);
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
}

.input-wrapper:focus-within .char-count {
    background: var(--color-primary-muted);
    color: var(--color-primary);
}

/* Chat Buttons */
.chat-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ==========================================
   SCROLL TO BOTTOM BUTTON
   ----------------------------------------
   Premium floating action button
   ========================================== */

.scroll-bottom-btn {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(
        135deg,
        var(--glass-bg-light) 0%,
        var(--glass-bg) 100%
    );
    backdrop-filter: blur(var(--blur-xl));
    -webkit-backdrop-filter: blur(var(--blur-xl));
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: var(--icon-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all var(--transition-spring);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-bottom-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-bottom-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        var(--shadow-xl),
        0 0 24px rgba(10, 132, 255, 0.4);
}

.scroll-bottom-btn:active {
    transform: translateY(0) scale(0.95);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Legacy compatibility */
.main-container { display: none; }
.top-bar { display: none; }
.header { display: none; }
.info-row { display: none; }
.toggle-row { display: none; }
.context-section { display: none; }
.progress-section { display: none; }
/* Project Complete Banner - Celebration Style */
.project-complete {
    display: none;
    padding: var(--space-5);
    margin: var(--space-3) var(--space-4);
    background: linear-gradient(
        135deg,
        var(--color-success-subtle) 0%,
        rgba(48, 209, 88, 0.2) 50%,
        var(--color-success-subtle) 100%
    );
    border: 1px solid var(--color-success-muted);
    border-radius: var(--radius-2xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.project-complete::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shine 3s infinite;
}

.project-complete.show {
    display: block;
    animation: scaleIn var(--duration-normal) var(--ease-spring);
}

.project-complete-icon {
    font-size: 48px;
    margin-bottom: var(--space-3);
    display: block;
    animation: bounce 2s infinite;
}

.project-complete-title {
    font-size: var(--text-h4);
    font-weight: var(--weight-bold);
    color: var(--color-success);
    margin-bottom: var(--space-2);
    text-shadow: 0 0 20px var(--color-success-muted);
}

.project-complete-text {
    font-size: var(--text-body-xs);
    color: var(--text-secondary);
}
/* Rate Limit Banner - Warning Style */
.rate-limit-banner {
    display: none;
    padding: var(--space-4);
    margin: var(--space-3) var(--space-4);
    background: linear-gradient(
        135deg,
        var(--color-warning-subtle) 0%,
        rgba(255, 159, 10, 0.15) 100%
    );
    border: 1px solid var(--color-warning-muted);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.rate-limit-banner.show {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    animation: slideInDown var(--duration-normal) var(--ease-spring);
}

.rate-limit-icon {
    font-size: var(--icon-lg);
    animation: pulse 2s infinite;
}

.rate-limit-content {
    flex: 1;
}

.rate-limit-title {
    font-size: var(--text-body-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-warning);
    margin-bottom: var(--space-1);
}

.rate-limit-countdown {
    font-size: var(--text-caption);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.rate-limit-countdown strong {
    color: var(--color-warning);
    font-weight: var(--weight-bold);
}
