/* Visualization-specific variables (supplements base.css) */
:root {
    --bg-tertiary: #1a2234;
    --glow-cyan: rgba(6, 182, 212, 0.3);
    --glow-violet: rgba(139, 92, 246, 0.3);
}

/* Control Bar */
.control-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 200px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.control-select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--glow-violet);
}

/* Account Search */
.account-search-container {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.account-search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.account-search-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--glow-cyan);
}

.account-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.account-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.account-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.account-result:last-child { border-bottom: none; }
.account-result:hover { background: var(--bg-tertiary); }

.account-result-name {
    font-weight: 500;
    color: var(--text-primary);
}

.account-result-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.selected-account {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--cyan);
    border-radius: 8px;
    font-size: 0.875rem;
}

.selected-account-name {
    color: var(--text-primary);
    font-weight: 500;
}

.clear-account-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.clear-account-btn:hover {
    color: var(--error);
    background: rgba(244, 63, 94, 0.1);
}

/* Report Type Badges */
.report-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.report-type-badge.external { background: rgba(6, 182, 212, 0.2); color: var(--cyan); }
.report-type-badge.market { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.report-type-badge.internal { background: rgba(139, 92, 246, 0.2); color: var(--purple); }
.report-type-badge.bespoke { background: rgba(16, 185, 129, 0.2); color: var(--success); }

/* Report Container */
.report-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.report-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(6, 182, 212, 0.1));
}

.report-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-title i { color: var(--purple); font-size: 1.25rem; }
.report-title h2 { font-size: 1.125rem; font-weight: 600; }

.report-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    background: var(--warning);
    animation: status-pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success);
    animation: none;
}

.status-dot.error {
    background: var(--error);
    animation: none;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#report-container {
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 600px;
    background: var(--bg-tertiary);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Error State */
.error-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    padding: 2rem;
    text-align: center;
}

.error-state i { font-size: 3rem; color: var(--error); }
.error-state h3 { color: var(--text-primary); font-size: 1.25rem; }
.error-state p { color: var(--text-secondary); max-width: 400px; }

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--glow-violet);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
    padding: 3rem;
    text-align: center;
}

.empty-state i { font-size: 4rem; color: var(--text-muted); opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); font-size: 1.25rem; }
.empty-state p { color: var(--text-secondary); max-width: 400px; }

/* Fullscreen */
.report-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    border-radius: 0;
    margin: 0;
}

.report-wrapper.fullscreen #report-container {
    height: calc(100vh - 60px);
}

.fullscreen-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.fullscreen-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Permission-based visibility */
.internal-only { display: none; }
body.is-internal .internal-only,
body.is-admin .internal-only { display: flex; }

/* Pastel Mode - Visualization-specific overrides */
.pastel-mode {
    --bg-tertiary: #fff5f7;
    --glow-cyan: rgba(244, 114, 182, 0.3);
    --glow-violet: rgba(219, 39, 119, 0.3);
}

.pastel-mode .control-select {
    background: #ffffff;
    border-color: #fecdd3;
    color: #881337;
}

.pastel-mode #report-container {
    background: #1a2234;
}

.pastel-mode .report-type-badge { color: #fff; }

.pastel-mode .selected-account {
    background: #fdf2f8;
    border-color: #f9a8d4;
    color: #881337;
}
