/**
 * Panel Styles
 * Side panels, modals, and overlays
 */

/* Dynamic Agent Status Island */
.agent-status-island {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    border-radius: 1rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    transition: var(--transition-slower);
    cursor: pointer;
    z-index: var(--z-status);
    overflow: hidden;
    user-select: none;
}

.agent-status-island:hover {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.agent-status-island.idle {
    width: 200px;
    height: 50px;
}

.agent-status-island.thinking {
    width: 280px;
    height: 60px;
    background: linear-gradient(135deg, rgba(135, 67, 225, 0.1), rgba(255, 255, 255, 0.95));
    border-color: var(--primary-500);
}

.agent-status-island.multi-agent {
    width: 380px;
    height: 70px;
    background: linear-gradient(135deg, rgba(251, 188, 4, 0.1), rgba(255, 255, 255, 0.95));
    border-color: var(--warning-500);
}

.agent-status-island.tools-active {
    width: 320px;
    height: 65px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.1), rgba(255, 255, 255, 0.95));
    border-color: var(--cyan-500);
}

.agent-status-island.complete {
    width: 300px;
    height: 60px;
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.1), rgba(255, 255, 255, 0.95));
    border-color: var(--success-500);
    animation: completePulse 2s ease-in-out;
}

.island-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    justify-content: space-between;
    opacity: 0;
    animation: fadeInContent 0.5s ease-out 0.2s forwards;
}

.island-left, .island-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.island-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.island-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.island-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Agent Avatars */
.agent-avatars {
    display: flex;
    gap: -0.125rem;
}

.agent-avatar {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: white;
    position: relative;
    transition: var(--transition-slow);
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin-left: -0.125rem;
}

.agent-avatar:first-child {
    margin-left: 0;
}

.agent-avatar.active {
    transform: scale(1.1);
    z-index: 2;
    border-color: white;
}

.agent-avatar.active::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 1px solid currentColor;
    animation: agentPulse 2s infinite;
}

.agent-avatar.coordinator { background: var(--primary-500); }
.agent-avatar.research { background: var(--cyan-500); }
.agent-avatar.code { background: var(--success-500); }
.agent-avatar.analysis { background: var(--warning-500); }

/* Progress Dots */
.progress-dots {
    display: flex;
    gap: 0.25rem;
}

.progress-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-500);
    animation: dotPulse 1.4s infinite ease-in-out;
}

.progress-dot:nth-child(2) { animation-delay: 0.2s; }
.progress-dot:nth-child(3) { animation-delay: 0.4s; }

/* Floating Header Cards */
.floating-header-container {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    z-index: var(--z-dropdown);
    pointer-events: none;
}

.floating-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    border-radius: 1rem;
    pointer-events: auto;
    transition: var(--transition-base);
    opacity: 0;
    transform: translateY(-10px);
    animation: slideInCard 0.5s ease-out 0.3s forwards;
}

.floating-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.header-card-left, .header-card-right {
    padding: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Side Panels */
.side-panel {
    position: fixed;
    left: 1rem;
    top: 6rem;
    width: 280px;
    height: calc(100vh - 8rem);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    transform: translateX(-110%);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: var(--z-panel);
    overflow: hidden;
}

.side-panel.open {
    transform: translateX(0);
}

.side-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(135, 67, 225, 0.05), rgba(255, 255, 255, 0.8));
}

.side-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-600);
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Settings Panel */
.settings-panel {
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-xl);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 1rem;
    top: 6rem;
    height: calc(100vh - 8rem);
    transform: translateX(110%);
    transition: transform 0.3s ease;
    z-index: var(--z-panel);
    max-height: calc(100vh - 8rem);
}

.settings-panel.open {
    transform: translateX(0);
}

.settings-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(135, 67, 225, 0.05), rgba(255, 255, 255, 0.8));
}

.settings-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-600);
}

.settings-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.settings-section {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.settings-section:last-child {
    border-bottom: none;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.setting-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    background: rgba(255, 255, 255, 0.8);
    transition: var(--transition-base);
    font-family: inherit;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(135, 67, 225, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* Setting Toggle */
.setting-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.setting-toggle span {
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.setting-toggle .toggle-switch {
    position: relative;
    width: 38px;
    height: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.setting-toggle .toggle-switch.active {
    background: var(--primary-500);
}

.setting-toggle .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.setting-toggle .toggle-switch.active .toggle-slider {
    transform: translateX(18px);
}

/* Panel Overlay */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: var(--z-sticky);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
    backdrop-filter: blur(3px);
}

.panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

.panel-overlay.computer-view {
    z-index: var(--z-overlay);
    background: rgba(0, 0, 0, 0.4);
}

/* No Tasks State */
.no-tasks {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.no-tasks i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.no-tasks p {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .agent-status-island {
        width: calc(100% - 2rem);
        max-width: 380px;
    }

    .side-panel,
    .settings-panel {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
    }

    .settings-panel {
        transform: translateX(110%);
    }

    .settings-panel.open {
        transform: translateX(0);
    }

    .floating-header-container {
        left: 0.5rem;
        right: 0.5rem;
    }
}
