/* ======================================
   Collaboration Bar Styles
   ====================================== */

.collab-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 24px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 2px solid #3b82f6;
    flex-wrap: wrap;
    min-height: 48px;
}

.collab-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.collab-icon {
    color: #60a5fa;
    font-size: 16px;
    animation: pulse-icon 2s ease-in-out infinite;
}
@keyframes pulse-icon {
    0%, 100% { opacity: .6; }
    50% { opacity: 1; }
}

/* Status indicator */
.collab-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,.07);
    border-radius: 20px;
    font-size: 12px;
    color: #94a3b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.disconnected { background: #64748b; }
.status-dot.connecting {
    background: #eab308;
    animation: blink 1s ease-in-out infinite;
}
.status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
}
.status-dot.error { background: #ef4444; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

.status-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Room input + join button */
.collab-room-form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.collab-room-form input {
    width: 130px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #475569;
    border-radius: 6px 0 0 6px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 13px;
    font-family: 'Inter', monospace;
    outline: none;
    transition: border-color .2s;
}
.collab-room-form input:focus {
    border-color: #3b82f6;
}
.collab-room-form input:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-collab-join {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 0 6px 6px 0;
    background: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-collab-join:hover { background: #1d4ed8; }
.btn-collab-join:disabled { opacity: .5; cursor: wait; }

.btn-collab-leave {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 0 6px 6px 0;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-collab-leave:hover { background: #b91c1c; }

/* Peers section */
.collab-peers {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 40px;
}

.collab-waiting {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
}

.peer-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    border: 2px solid rgba(255,255,255,.2);
    cursor: default;
    transition: transform .2s;
    flex-shrink: 0;
}
.peer-avatar:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,.5);
}

/* My name + avatar */
.collab-me {
    margin-left: auto;
}
.collab-name-edit {
    display: flex;
    align-items: center;
    gap: 6px;
}
.collab-name-edit input {
    width: 110px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #cbd5e1;
    font-size: 12px;
    font-family: inherit;
    text-align: right;
    outline: none;
    transition: all .2s;
}
.collab-name-edit input:hover {
    background: rgba(255,255,255,.05);
    border-color: #475569;
}
.collab-name-edit input:focus {
    background: rgba(255,255,255,.1);
    border-color: #3b82f6;
    color: #f1f5f9;
}

.my-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    border: 2px solid rgba(255,255,255,.4);
    flex-shrink: 0;
}

/* Share button */
.btn-share {
    height: 30px;
    padding: 0 12px;
    border: 1px solid #22c55e;
    border-radius: 6px;
    background: rgba(34,197,94,.1);
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-share:hover {
    background: rgba(34,197,94,.2);
    color: #86efac;
}

/* Activity flash */
.collab-activity {
    padding: 4px 12px;
    background: rgba(255,255,255,.05);
    border-left: 3px solid #3b82f6;
    border-radius: 0 4px 4px 0;
    font-size: 11px;
    color: #94a3b8;
    transition: opacity .3s;
    white-space: nowrap;
}
.collab-activity.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Toast notification */
.collab-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 10px 20px;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: 999;
    transition: transform .3s ease, opacity .3s;
    opacity: 0;
    pointer-events: none;
}
.collab-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .collab-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    .collab-room-form input { width: 90px; }
    .collab-me { margin-left: 0; }
    .collab-name-edit input { width: 80px; }
}
