bayan-api / extension /sidepanel /sidepanel.css
youssefreda9's picture
Update extension UI, app pipeline, and Spelling Rules
75e0099
Raw
History Blame Contribute Delete
29.8 kB
/* ══════════════════════════════════════════════
Bayan Side Panel — Styles
Persistent workspace | RTL | Dark premium
Matches popup design system
══════════════════════════════════════════════ */
/* ── Design Tokens (shared with popup) ── */
:root {
--sp-primary: var(--color-primary, #6BA3E0);
--sp-primary-light: var(--color-secondary, #A594E8);
--sp-primary-dark: var(--color-primary, #6BA3E0);
--sp-primary-glow: var(--focus-ring, rgba(107, 163, 224, 0.42));
--sp-bg: var(--color-bg, #12141A);
--sp-surface: var(--color-surface, #1A1D26);
--sp-surface-hover: var(--color-surface-elevated, #242833);
--sp-surface-active: var(--color-surface-elevated, #242833);
--sp-border: var(--color-border, rgba(236, 238, 242, 0.09));
--sp-border-light: var(--color-border-strong, rgba(236, 238, 242, 0.16));
--sp-text: var(--color-text-primary, #ECEEF2);
--sp-text-secondary: var(--color-text-secondary, #B4BBC6);
--sp-text-muted: var(--color-text-muted, #8A939F);
--sp-success: var(--color-success, #6BC98A);
--sp-warning: var(--color-warning, #E4B35A);
--sp-error: var(--color-error, #E88A8A);
--sp-spelling: var(--color-error, #E88A8A);
--sp-grammar: var(--color-warning, #E4B35A);
--sp-punctuation: var(--color-success, #6BC98A);
--sp-radius: var(--radius-md, 0.75rem);
--sp-radius-sm: var(--radius-sm, 0.5rem);
--sp-radius-lg: var(--radius-lg, 1rem);
--sp-font: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
--sp-font-arabic: var(--font-family-primary, 'Cairo', 'Tajawal', 'Noto Sans Arabic', sans-serif);
--sp-transition: var(--transition-base, 0.2s ease);
--sp-spring: var(--transition-spring, 0.4s cubic-bezier(0.34, 1.56, 0.64, 1));
--color-surface-hover: var(--color-surface-elevated, #242833);
}
/* ── Reset ── */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
width: 100%;
min-height: 100vh;
overflow-y: auto;
overflow-x: hidden;
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 13px;
line-height: 1.6;
color: var(--text-color);
background: var(--color-bg);
direction: rtl;
-webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
/* ══════════════════════════════════════════════
Header
══════════════════════════════════════════════ */
.sp-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
background: linear-gradient(135deg, var(--color-surface) 0%, rgba(99, 102, 241, 0.08) 100%);
border-bottom: 1px solid var(--color-border);
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(12px);
}
.sp-header-brand {
display: flex;
align-items: center;
gap: 8px;
}
.sp-header-title {
font-size: 16px;
font-weight: 700;
background: linear-gradient(135deg, var(--secondary-color), #a78bfa);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: -0.5px;
}
.sp-header-status {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--sp-text-muted);
}
.sp-status-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--sp-text-muted);
transition: background var(--sp-transition);
}
.sp-status-dot.online { background: var(--sp-success); box-shadow: 0 0 6px var(--sp-success); }
.sp-status-dot.offline { background: var(--sp-error); }
.sp-status-text { font-size: 10px; }
/* ══════════════════════════════════════════════
Tabs
══════════════════════════════════════════════ */
.sp-tabs {
display: flex;
gap: 0;
padding: 0 14px;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
}
.sp-tab {
flex: 1 1 auto;
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 8px 6px;
border: none;
background: transparent;
color: var(--sp-text-muted);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: all var(--sp-transition);
position: relative;
white-space: nowrap;
min-width: 0;
}
.sp-tab::after {
content: '';
position: absolute;
bottom: 0;
left: 20%;
right: 20%;
height: 2px;
background: var(--primary-color);
border-radius: 2px 2px 0 0;
opacity: 0;
transform: scaleX(0);
transition: all var(--sp-spring);
}
.sp-tab:hover { color: var(--text-color); background: var(--color-surface-hover); }
.sp-tab.active {
color: var(--secondary-color);
}
.sp-tab.active::after {
opacity: 1;
transform: scaleX(1);
}
/* ══════════════════════════════════════════════
Panels
══════════════════════════════════════════════ */
.sp-panel {
display: none;
padding: 12px 14px;
animation: spFadeIn 200ms ease;
}
.sp-panel.active { display: block; }
@keyframes spFadeIn {
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
/* ══════════════════════════════════════════════
Input
══════════════════════════════════════════════ */
.sp-input-group {
margin-bottom: 10px;
}
.sp-label-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.sp-label {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
}
.sp-textarea {
width: 100%;
padding: 10px 12px;
border: 1px solid var(--color-border);
border-radius: var(--sp-radius);
background: var(--color-surface);
color: var(--text-color);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 14px;
line-height: 1.7;
resize: vertical;
min-height: 80px;
transition: border-color var(--sp-transition), box-shadow var(--sp-transition);
}
.sp-textarea:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px var(--sp-primary-glow);
}
.sp-textarea::placeholder {
color: var(--color-placeholder, var(--sp-text-muted));
font-size: 13px;
}
.sp-meta-row {
display: flex;
gap: 12px;
margin-top: 4px;
padding: 0 2px;
}
.sp-char-count,
.sp-word-count {
font-size: 10px;
color: var(--sp-text-muted);
}
/* ══════════════════════════════════════════════
Buttons
══════════════════════════════════════════════ */
.sp-actions {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.sp-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 7px 14px;
border: none;
border-radius: var(--sp-radius-sm);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: all var(--sp-transition);
}
.sp-btn-primary {
flex: 1;
background: linear-gradient(135deg, var(--color-primary, #6BA3E0), var(--color-secondary, #A594E8));
color: white;
box-shadow: 0 2px 8px var(--sp-primary-glow);
}
.sp-btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 14px var(--sp-primary-glow);
}
.sp-btn-primary:active {
transform: translateY(0);
}
.sp-btn-ghost {
background: var(--color-surface);
color: var(--text-secondary);
border: 1px solid var(--color-border);
}
.sp-btn-ghost:hover {
background: var(--color-surface-hover);
color: var(--text-color);
}
.sp-btn-sm {
padding: 5px 12px;
font-size: 11px;
background: var(--primary-color);
color: white;
border: none;
border-radius: var(--sp-radius-sm);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-weight: 600;
cursor: pointer;
transition: all var(--sp-transition);
}
.sp-btn-sm:hover {
background: var(--sp-primary-dark);
}
.sp-btn-icon {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: none;
border-radius: var(--sp-radius-sm);
background: var(--color-surface);
color: var(--text-secondary);
cursor: pointer;
transition: all var(--sp-transition);
}
.sp-btn-icon:hover {
background: var(--color-surface-hover);
color: var(--secondary-color);
}
/* ══════════════════════════════════════════════
Score (matching popup — vertical centered with gradient)
══════════════════════════════════════════════ */
.sp-score {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 16px 12px;
margin-bottom: 12px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--sp-radius);
animation: spFadeIn 300ms ease;
}
.sp-score-title {
font-size: 13px;
font-weight: 600;
color: var(--text-secondary);
margin-bottom: 10px;
}
.sp-score-ring {
position: relative;
width: 120px;
height: 120px;
flex-shrink: 0;
margin-bottom: 8px;
}
.sp-score-ring svg {
display: block;
}
.sp-score-ring circle:last-child {
transition: stroke-dashoffset 600ms ease-in-out;
}
.sp-score-value {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
font-weight: 700;
color: var(--color-text-primary, var(--text-color));
}
.sp-score-hint {
display: block;
font-size: 12px;
color: var(--text-secondary);
margin-bottom: 8px;
}
.sp-score-counts {
display: flex;
gap: 10px;
flex-wrap: wrap;
justify-content: center;
}
.sp-count {
font-size: 11px;
color: var(--sp-text-muted);
display: flex;
align-items: center;
gap: 3px;
}
.sp-count span {
font-weight: 700;
}
.sp-count-spelling span { color: var(--sp-spelling); }
.sp-count-grammar span { color: var(--sp-grammar); }
.sp-count-punctuation span { color: var(--sp-punctuation); }
/* ══════════════════════════════════════════════
Results
══════════════════════════════════════════════ */
.sp-result {
margin-bottom: 12px;
border: 1px solid var(--color-border);
border-radius: var(--sp-radius);
background: var(--color-surface);
overflow: hidden;
animation: spFadeIn 300ms ease;
}
.sp-result-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
font-size: 11px;
font-weight: 700;
color: var(--text-secondary);
background: var(--color-surface-hover);
border-bottom: 1px solid var(--color-border);
}
.sp-result-title {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
}
.sp-result-actions {
display: flex;
align-items: center;
gap: 2px;
}
.sp-result-text {
padding: 10px 12px;
font-size: 14px;
line-height: 1.8;
color: var(--text-color);
word-break: break-word;
}
/* ══════════════════════════════════════════════
Highlighted text (from bayan-renderer.js)
══════════════════════════════════════════════ */
.bayan-spelling-error {
background: rgba(239, 68, 68, 0.15);
border-bottom: 2px solid var(--sp-spelling);
padding: 0 2px;
border-radius: 2px;
cursor: pointer;
}
.bayan-grammar-error {
background: rgba(245, 158, 11, 0.15);
border-bottom: 2px solid var(--sp-grammar);
padding: 0 2px;
border-radius: 2px;
cursor: pointer;
}
.bayan-punctuation-suggestion {
background: rgba(107, 201, 138, 0.14);
border-bottom: 2px solid var(--sp-punctuation);
padding: 0 2px;
border-radius: 2px;
cursor: pointer;
}
/* ══════════════════════════════════════════════
Suggestions
══════════════════════════════════════════════ */
.sp-suggestions {
margin-bottom: 12px;
animation: spFadeIn 300ms ease;
}
.sp-suggestions-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.sp-suggestions-title {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
}
.sp-suggestions-list {
display: flex;
flex-direction: column;
gap: 8px;
}
/* Suggestion card — reuses bayan-ui.js HTML classes */
.bayan-suggestion-card {
padding: var(--spacing-md, 16px);
padding-right: calc(var(--spacing-md, 16px) + 4px);
background: var(--color-surface-elevated, var(--color-surface));
border: 1px solid var(--color-border);
border-right: 4px solid var(--color-border-strong, rgba(236, 238, 242, 0.16));
border-radius: 12px;
cursor: pointer;
transition: border-color var(--sp-transition), background var(--sp-transition), transform var(--sp-transition);
text-align: right;
}
.bayan-suggestion-card:hover {
border-top-color: var(--primary-color);
border-bottom-color: var(--primary-color);
border-left-color: var(--primary-color);
background: var(--color-suggestion-hover-bg, var(--color-surface-hover));
transform: translateX(-2px);
}
.bayan-suggestion-card:has(.bayan-badge-spelling) { border-right-color: var(--sp-spelling, var(--color-error)); }
.bayan-suggestion-card:has(.bayan-badge-grammar) { border-right-color: var(--sp-grammar, var(--color-warning)); }
.bayan-suggestion-card:has(.bayan-badge-punctuation) { border-right-color: var(--sp-punctuation, var(--color-success)); }
.bayan-suggestion-badge {
display: inline-block;
padding: 2px 8px;
border-radius: 999px;
font-size: 12px;
font-weight: 700;
margin-bottom: 6px;
}
.bayan-badge-spelling { background: rgba(232, 138, 138, 0.18); color: var(--sp-spelling); }
.bayan-badge-grammar { background: rgba(228, 179, 90, 0.18); color: var(--sp-grammar); }
.bayan-badge-punctuation { background: rgba(107, 201, 138, 0.16); color: var(--sp-punctuation); }
.bayan-suggestion-change {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 6px;
font-size: 14px;
}
.bayan-suggestion-original {
color: var(--sp-text-muted);
text-decoration: line-through;
}
.bayan-suggestion-arrow {
color: var(--sp-text-muted);
font-size: 12px;
}
.bayan-suggestion-correction {
color: var(--sp-success);
font-weight: 600;
}
.bayan-suggestion-alts {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.bayan-alt-chip {
padding: 4px 10px;
border: 1px solid var(--color-border);
border-radius: 100px;
background: var(--color-surface);
color: var(--text-color);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 12px;
cursor: pointer;
transition: all var(--sp-transition);
}
.bayan-alt-chip:hover {
border-color: var(--primary-color);
color: var(--text-primary, var(--text-color));
background: var(--color-surface-elevated, var(--color-surface-hover));
}
.bayan-alt-chip--main {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
border-color: transparent;
color: white;
font-weight: 700;
}
.bayan-alt-chip--main:hover {
opacity: 0.9;
border-color: transparent;
}
.bayan-alt-chip--keep {
border-style: dashed;
color: var(--sp-text-muted);
font-size: 11px;
}
.bayan-alt-chip--keep:hover {
color: var(--text-primary, var(--text-color));
}
/* ── Apply All Button ── */
.sp-apply-all-btn {
width: 100%;
margin-top: 10px;
padding: 10px 18px;
border: none;
border-radius: 12px;
background: linear-gradient(135deg, var(--primary-color, #6BA3E0), var(--secondary-color, #A594E8));
color: var(--color-text-inverse, #F4F5F7);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 14px;
font-weight: 700;
cursor: pointer;
min-height: 44px;
transition: opacity 200ms ease, transform 150ms ease;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.sp-apply-all-btn:hover { opacity: 0.92; }
.sp-apply-all-btn:active { transform: scale(0.98); }
/* ── Empty State ── */
.sp-empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 24px 16px;
text-align: center;
gap: 8px;
}
.sp-empty-state-icon-wrap {
width: 48px;
height: 48px;
border-radius: 50%;
background: var(--color-surface-elevated, #242833);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4px;
}
.sp-empty-state-title {
font-size: 14px;
font-weight: 600;
color: var(--color-text-secondary, var(--text-secondary));
}
.sp-empty-state-desc {
font-size: 12px;
color: var(--color-text-muted, var(--sp-text-muted));
line-height: 1.6;
}
/* ── Score Hint Subtitle ── */
.sp-score-hint-sub {
font-size: 11px;
color: var(--color-text-muted, var(--sp-text-muted));
display: block;
margin-top: 2px;
}
/* ══════════════════════════════════════════════
Summary Mode Toggle (paragraph / bullets)
══════════════════════════════════════════════ */
.sp-mode-toggle {
display: flex;
gap: 0;
margin-bottom: 12px;
border: 1px solid var(--color-border);
border-radius: var(--sp-radius-sm);
overflow: hidden;
}
.sp-mode-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 7px 10px;
border: none;
background: transparent;
color: var(--sp-text-muted);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: all var(--sp-transition);
}
.sp-mode-btn + .sp-mode-btn {
border-right: 1px solid var(--color-border);
}
.sp-mode-btn:hover {
background: var(--color-surface-hover);
color: var(--text-color);
}
.sp-mode-btn.active {
background: var(--primary-color);
color: white;
}
/* ══════════════════════════════════════════════
Summary Stats
══════════════════════════════════════════════ */
.sp-summary-stats {
display: flex;
gap: 16px;
padding: 8px 12px;
border-bottom: 1px solid var(--color-border);
}
.sp-summary-stat {
font-size: 11px;
color: var(--sp-text-muted);
display: flex;
gap: 4px;
}
.sp-summary-stat-value {
font-weight: 700;
color: var(--text-secondary);
}
/* ══════════════════════════════════════════════
Description paragraph (dialect panel)
══════════════════════════════════════════════ */
.sp-description {
font-size: 11px;
color: var(--sp-text-muted);
margin-bottom: 8px;
line-height: 1.6;
}
/* ══════════════════════════════════════════════
Input meta row (word count + import)
══════════════════════════════════════════════ */
.sp-input-meta-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 6px;
}
.sp-input-meta {
font-size: 11px;
color: var(--sp-text-muted);
}
.sp-sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
}
.sp-import-btn {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 10px;
font-size: 11px;
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
color: var(--text-secondary);
border: 1px solid var(--color-border);
border-radius: var(--sp-radius-sm);
background: transparent;
cursor: pointer;
transition: all var(--sp-transition);
}
.sp-import-btn:hover {
background: var(--color-surface-hover);
color: var(--text-color);
border-color: var(--primary-color);
}
/* ══════════════════════════════════════════════
Export dropdown
══════════════════════════════════════════════ */
.sp-export-dropdown {
position: relative;
}
.sp-export-menu {
position: absolute;
top: 100%;
left: 0;
min-width: 130px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--sp-radius-sm);
box-shadow: 0 4px 16px rgba(0,0,0,0.25);
z-index: 50;
overflow: hidden;
}
.sp-export-item {
display: block;
width: 100%;
padding: 8px 12px;
border: none;
background: transparent;
color: var(--text-color);
font-family: var(--font-family-primary, 'Cairo', 'Tajawal', sans-serif);
font-size: 12px;
text-align: right;
cursor: pointer;
transition: background var(--sp-transition);
}
.sp-export-item:hover {
background: var(--color-surface-hover);
}
/* ══════════════════════════════════════════════
Length selector
══════════════════════════════════════════════ */
.sp-length-selector {
margin-bottom: 12px;
}
.sp-radio-group {
display: flex;
gap: 12px;
margin-top: 4px;
padding: 0 2px;
}
.sp-radio {
display: flex;
align-items: center;
gap: 4px;
font-size: 11px;
color: var(--text-secondary);
cursor: pointer;
}
.sp-radio input[type="radio"] {
accent-color: var(--primary-color);
width: 13px;
height: 13px;
}
/* ══════════════════════════════════════════════
Quran result (matching popup)
══════════════════════════════════════════════ */
.sp-quran-result {
background: var(--color-surface);
border: 1px solid rgba(6, 182, 212, 0.2);
border-radius: var(--sp-radius);
padding: 14px;
animation: spFadeIn 300ms ease;
}
.sp-quran-result-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.sp-quran-uthmani {
font-family: 'Amiri Quran', 'Cairo', serif;
font-size: 20px;
line-height: 2.2;
text-align: center;
color: var(--text-color);
margin-bottom: 4px;
}
.sp-quran-reference {
text-align: center;
font-size: 12px;
font-weight: 600;
color: #06b6d4;
margin-bottom: 8px;
}
.sp-quran-translate {
border-top: 1px solid var(--color-border);
padding-top: 10px;
margin-top: 10px;
}
.sp-quran-translate-row {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
margin-bottom: 8px;
}
.sp-quran-translation {
padding: 10px;
border-radius: var(--sp-radius-sm);
background: rgba(6, 182, 212, 0.06);
border: 1px solid rgba(6, 182, 212, 0.15);
}
.sp-quran-translation p {
font-size: 16px;
line-height: 2;
text-align: center;
color: var(--text-color);
}
.sp-quran-match-list {
display: flex;
flex-direction: column;
gap: 12px;
max-height: 500px;
overflow-y: auto;
}
.sp-quran-match-card {
background: var(--color-surface);
border: 1px solid rgba(6, 182, 212, 0.2);
border-radius: var(--sp-radius);
padding: 14px;
animation: spFadeIn 300ms ease;
}
.sp-select {
flex: 1;
min-width: 140px;
padding: 6px 10px;
font-size: 13px;
color: var(--text-color);
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 8px;
cursor: pointer;
}
.sp-select:focus {
outline: none;
border-color: #06b6d4;
}
.sp-select option {
background: var(--color-surface);
color: var(--text-color);
}
/* ══════════════════════════════════════════════
Timing
══════════════════════════════════════════════ */
.sp-timing {
padding: 6px 10px;
margin-bottom: 8px;
background: var(--color-surface);
border-radius: var(--sp-radius-sm);
font-size: 10px;
color: var(--sp-text-muted);
text-align: center;
}
/* ══════════════════════════════════════════════
Loading overlay
══════════════════════════════════════════════ */
.sp-loading {
position: fixed;
inset: 0;
z-index: 200;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
background: var(--color-overlay, rgba(15, 15, 20, 0.85));
backdrop-filter: blur(6px);
color: var(--text-color);
font-size: 13px;
}
.sp-spinner {
width: 32px;
height: 32px;
border: 3px solid var(--color-border);
border-top-color: var(--primary-color);
border-radius: 50%;
animation: spSpin 800ms linear infinite;
}
@keyframes spSpin {
to { transform: rotate(360deg); }
}
/* ══════════════════════════════════════════════
Toast
══════════════════════════════════════════════ */
.sp-toast {
position: fixed;
bottom: 16px;
left: 50%;
transform: translateX(-50%) translateY(60px);
padding: 8px 16px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 20px;
color: var(--text-color);
font-size: 12px;
font-weight: 600;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
opacity: 0;
pointer-events: none;
transition: all var(--sp-spring);
z-index: 300;
white-space: nowrap;
}
.sp-toast.is-visible {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
/* ══════════════════════════════════════════════
Stale indicator
══════════════════════════════════════════════ */
.sp-stale {
opacity: 0.45;
pointer-events: none;
position: relative;
filter: grayscale(30%);
transition: opacity var(--sp-transition), filter var(--sp-transition);
}
.sp-stale::after {
content: '⚠ أعد التحليل';
position: absolute;
top: 8px;
left: 50%;
transform: translateX(-50%);
padding: 4px 12px;
background: var(--sp-warning);
color: #000;
font-size: 10px;
font-weight: 700;
border-radius: 12px;
z-index: 10;
pointer-events: none;
white-space: nowrap;
}
/* ══════════════════════════════════════════════
Utilities
══════════════════════════════════════════════ */
.is-hidden {
display: none !important;
}
/* Theme Toggle Button Styles */
.theme-toggle-animated {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: none;
border-radius: 50%;
background: var(--color-surface-hover);
color: var(--text-secondary);
cursor: pointer;
transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease;
position: relative;
overflow: hidden;
margin-right: 8px;
}
.theme-toggle-animated:hover {
background: var(--primary-color);
color: #fff;
transform: rotate(15deg);
}
.theme-toggle-animated svg {
transition: transform 0.4s ease, opacity 0.3s ease;
position: absolute;
}
[data-theme="dark"] .theme-icon-sun {
transform: rotate(90deg) scale(0);
opacity: 0;
}
[data-theme="dark"] .theme-icon-moon {
transform: rotate(0) scale(1);
opacity: 1;
}
[data-theme="light"] .theme-icon-moon {
transform: rotate(-90deg) scale(0);
opacity: 0;
}
[data-theme="light"] .theme-icon-sun {
transform: rotate(0) scale(1);
opacity: 1;
}