/* ═══════════════════════════════════════════════════════════════════════════
   Arya Account Widget — Shared Component Styles
   Used by: Home (/), Creator (/creator), Studio (/studio)

   Naming convention: arya-acct-* namespace to avoid conflicts with page-local styles.
   All CSS variables include fallback values for pages that may not define them.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Status Badge (WebSocket indicator; preserved for Creator) ── */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-danger, #ef4444);
    box-shadow: 0 0 8px var(--color-danger, #ef4444);
    transition: all 0.3s ease;
}

.status-dot.connecting {
    background-color: var(--color-warning, #f59e0b);
    box-shadow: 0 0 8px var(--color-warning, #f59e0b);
    animation: arya-acct-pulse 1.5s infinite;
}

.status-dot.connected {
    background-color: var(--color-success, #10b981);
    box-shadow: 0 0 8px var(--color-success, #10b981);
}

.status-dot.processing {
    background-color: var(--color-warning, #f59e0b);
    box-shadow: 0 0 8px var(--color-warning, #f59e0b);
    animation: arya-acct-pulse 1s infinite;
}

.status-dot.idle {
    background-color: var(--color-success, #10b981);
    box-shadow: 0 0 8px var(--color-success, #10b981);
}

/* ── User Area Container ── */
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Account Button ── */
.arya-acct-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #e2e8f0;
    position: relative;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.arya-acct-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary, #6366f1);
}

/* ── Avatar ── */
.arya-acct-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

/* ── Dropdown Arrow ── */
.arya-acct-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.arya-acct-btn.open .arya-acct-arrow {
    transform: rotate(180deg);
}

/* ── Dropdown Menu ── */
.arya-acct-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color, #334155);
    border-radius: 10px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.arya-acct-dropdown.show {
    display: block;
}

/* ── Dropdown User Info Section ── */
.arya-acct-dropdown-info {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #334155);
}

.arya-acct-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.arya-acct-dropdown-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Dropdown Items ── */
.arya-acct-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.arya-acct-dropdown-item:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.arya-acct-item-icon {
    font-size: 16px;
}

/* Edit button uses a neutral hover instead of red */
.arya-acct-edit-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

/* ── Edit Profile Modal Overlay ── */
.arya-acct-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

/* ── Modal Panel ── */
.arya-acct-modal {
    background-color: var(--bg-chat, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.arya-acct-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 10px;
}

.arya-acct-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main, #e2e8f0);
    margin: 0;
}

.arya-acct-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.arya-acct-modal-close:hover {
    color: var(--text-main, #e2e8f0);
    background: rgba(255, 255, 255, 0.08);
}

.arya-acct-modal-body {
    padding: 0 16px 16px;
}

/* ── Form Elements ── */
.arya-acct-form-group {
    margin-top: 16px;
}

.arya-acct-form-group:first-child {
    margin-top: 0;
}

.arya-acct-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0;
}

.arya-acct-form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #334155);
    background: #1e293b;
    color: #e2e8f0;
    margin-top: 6px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.arya-acct-form-group input:focus {
    border-color: var(--color-primary, #6366f1);
}

/* ── Modal Footer ── */
.arya-acct-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #334155);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.arya-acct-btn-cancel {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #334155);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.arya-acct-btn-cancel:hover {
    border-color: var(--text-muted, #94a3b8);
}

.arya-acct-btn-save {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: opacity 0.2s;
}

.arya-acct-btn-save:hover {
    opacity: 0.9;
}

.arya-acct-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Pulse Animation ── */
@keyframes arya-acct-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Workspace Dialog
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ── */
.arya-workspace-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

/* ── Modal ── */
.arya-workspace-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    width: 90%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.arya-workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #334155;
}

.arya-workspace-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.arya-workspace-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.arya-workspace-close:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

/* ── Body ── */
.arya-workspace-body {
    padding: 20px;
}

.arya-workspace-form-group {
    margin-bottom: 12px;
}

.arya-workspace-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #e2e8f0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    margin-bottom: 8px;
}

.arya-workspace-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arya-workspace-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    transition: border-color 0.2s;
}

.arya-workspace-input:focus {
    border-color: #6366f1;
}

.arya-workspace-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.15s;
}

.arya-workspace-edit-btn:hover {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
}

.arya-workspace-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    font-size: 12px;
    color: #93c5fd;
    line-height: 1.5;
    margin-bottom: 8px;
}

.arya-workspace-hint span:first-child {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Status Message ── */
.arya-workspace-status {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.arya-workspace-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.arya-workspace-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* ── Footer ── */
.arya-workspace-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 20px;
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.3);
}

.arya-workspace-btn-cancel {
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.arya-workspace-btn-cancel:hover {
    border-color: #94a3b8;
}

.arya-workspace-btn-save {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.arya-workspace-btn-save:hover {
    opacity: 0.9;
}

.arya-workspace-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
