/* style.css */ :root { --teal-gradient: linear-gradient(135deg, #00bfa5, #008c7a); --pill-selected-bg: rgba(255, 255, 255, 0.3); --theme-selected-bg: rgba(255, 255, 255, 0.25); --theme-loading-fade: rgba(255, 255, 255, 0.5); } body { /* No body styles needed globally */ } /* Theme classes for the body (for future use) */ body.science-theme, body.maths-theme, body.reader-theme { /* Can be used for body-specific themeing if needed later */ } #sparx-ai-ui { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; align-items: center; gap: 10px; background-color: rgba(28, 28, 30, 0.75); backdrop-filter: blur(12px) saturate(180%); -webkit-backdrop-filter: blur(12px) saturate(180%); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 10px 15px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; transition: all 0.3s ease; } /* Remove theme background overrides */ #sparx-ai-ui.science-theme, #sparx-ai-ui.maths-theme, #sparx-ai-ui.reader-theme { background-color: rgba(28, 28, 30, 0.75); backdrop-filter: blur(12px) saturate(180%); -webkit-backdrop-filter: blur(12px) saturate(180%); } #sparx-ai-title { color: #f5f5f7; font-weight: 600; font-size: 15px; padding-right: 10px; /* Add some spacing */ } /* Button Wrapper */ #button-wrapper { display: flex; align-items: center; background-color: rgba(60, 60, 62, 0.75); border-radius: 12px; padding: 2px; } /* Main action button */ #auto-answer-button { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; background: var(--theme-gradient); color: white; border: none; border-radius: 12px; padding: 8px 14px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 20px rgba(var(--theme-glow-rgb), 0.4), 0 0 40px rgba(var(--theme-glow-rgb), 0.2), 0 0 60px rgba(var(--theme-glow-rgb), 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(var(--theme-glow-rgb), 0.2); backdrop-filter: blur(4px); } /* Theme-specific button colors - move up for precedence */ .science-theme #auto-answer-button { --theme-glow-rgb: 0, 191, 165; /* Brighter teal RGB */ background: var(--teal-gradient); box-shadow: 0 0 20px rgba(0, 191, 165, 0.4), 0 0 40px rgba(0, 191, 165, 0.2), 0 0 60px rgba(0, 191, 165, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(0, 191, 165, 0.2); } .maths-theme #auto-answer-button { --theme-glow-rgb: 54, 135, 241; /* Blue RGB */ background: #3687F1; box-shadow: 0 0 20px rgba(54, 135, 241, 0.4), 0 0 40px rgba(54, 135, 241, 0.2), 0 0 60px rgba(54, 135, 241, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(54, 135, 241, 0.2); } .reader-theme #auto-answer-button { --theme-glow-rgb: 109, 97, 244; /* Purple RGB */ background: linear-gradient(to right, #6D61F4, #4534D4); box-shadow: 0 0 20px rgba(109, 97, 244, 0.4), 0 0 40px rgba(109, 97, 244, 0.2), 0 0 60px rgba(109, 97, 244, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(109, 97, 244, 0.2); } #auto-answer-button:hover { filter: brightness(1.15); transform: scale(1.05); box-shadow: 0 0 30px rgba(var(--theme-glow-rgb), 0.7), 0 0 60px rgba(var(--theme-glow-rgb), 0.4), 0 0 90px rgba(var(--theme-glow-rgb), 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(var(--theme-glow-rgb), 0.3); } #auto-answer-button:active { transform: scale(0.98); box-shadow: 0 0 15px rgba(var(--theme-glow-rgb), 0.5), 0 0 30px rgba(var(--theme-glow-rgb), 0.25), inset 0 0 10px rgba(255, 255, 255, 0.2); } #auto-answer-button.learn-mode { filter: brightness(1.15); box-shadow: 0 0 30px rgba(var(--theme-glow-rgb), 0.7), 0 0 60px rgba(var(--theme-glow-rgb), 0.4), 0 0 90px rgba(var(--theme-glow-rgb), 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(var(--theme-glow-rgb), 0.3); } #auto-answer-button.learn-mode:hover { filter: brightness(1.3); } #auto-answer-button.manual-mode { --manual-glow-rgb: 88, 86, 214; background: linear-gradient(135deg, #5856d6, #4a48c4); box-shadow: 0 0 20px rgba(88, 86, 214, 0.4), 0 0 40px rgba(88, 86, 214, 0.2), 0 0 60px rgba(88, 86, 214, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(88, 86, 214, 0.2); } #auto-answer-button.manual-mode:hover { box-shadow: 0 0 30px rgba(88, 86, 214, 0.7), 0 0 60px rgba(88, 86, 214, 0.4), 0 0 90px rgba(88, 86, 214, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(88, 86, 214, 0.3); } #auto-answer-button:disabled { background-color: #555; color: #999; cursor: not-allowed; } #auto-answer-button:disabled:hover { transform: none; filter: none; } #auto-answer-button svg { width: 16px; height: 16px; flex-shrink: 0; transform-origin: center; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes pulse-icon-color { 0%, 100% { fill: #ffffff; } 50% { fill: var(--theme-loading-fade); } } #auto-answer-button.loading svg { animation: spin 1s linear infinite, pulse-icon-color 2s ease-in-out infinite; } /* Elastic unwind effect for bolt */ @keyframes bolt-unwind { 0% { transform: rotate(360deg); } 60% { transform: rotate(-20deg); } 80% { transform: rotate(10deg); } 100% { transform: rotate(0deg); } } #auto-answer-button svg.unwinding { animation: bolt-unwind 0.7s cubic-bezier(0.68,-0.55,0.27,1.55); } #auto-answer-button.loading:disabled { background: var(--theme-selected-bg); color: white; } /* Enhanced loading animation */ #auto-answer-button.loading { animation: pulse-glow 2s ease-in-out infinite; } @keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 20px rgba(var(--theme-glow-rgb), 0.5), 0 0 40px rgba(var(--theme-glow-rgb), 0.3), 0 0 60px rgba(var(--theme-glow-rgb), 0.15), inset 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 5px rgba(var(--theme-glow-rgb), 0.2); } 50% { box-shadow: 0 0 30px rgba(var(--theme-glow-rgb), 0.7), 0 0 60px rgba(var(--theme-glow-rgb), 0.4), 0 0 90px rgba(var(--theme-glow-rgb), 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(var(--theme-glow-rgb), 0.3); } } /* Enhanced cancel mode glow */ #auto-answer-button.cancel-mode { background-color: #ff3b30 !important; animation: pulse-cancel 1.5s ease-in-out infinite; } @keyframes pulse-cancel { 0%, 100% { background-color: #ff3b30; transform: scale(1); box-shadow: 0 0 20px rgba(255, 59, 48, 0.4), 0 0 40px rgba(255, 59, 48, 0.2), 0 0 60px rgba(255, 59, 48, 0.1), inset 0 0 15px rgba(255, 255, 255, 0.3); } 50% { background-color: #ff6b5b; transform: scale(1.02); box-shadow: 0 0 30px rgba(255, 59, 48, 0.6), 0 0 60px rgba(255, 59, 48, 0.3), 0 0 90px rgba(255, 59, 48, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.4); } } /* Options Toggle Button */ #options-toggle-button { background: none; border: none; cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; border-left: 1px solid rgba(255, 255, 255, 0.1); margin-left: 4px; } #options-toggle-button svg { width: 18px; height: 18px; color: #a0a0a5; transition: transform 0.3s ease; } #options-toggle-button.active svg { transform: rotate(180deg); } /* Options Panel */ #options-panel { position: absolute; bottom: calc(100% + 10px); left: 0; width: 100%; background-color: rgba(44, 44, 46, 0.85); border-radius: 12px; padding: 10px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; box-sizing: border-box; } #options-panel.visible { opacity: 1; transform: translateY(0); pointer-events: auto; } .options-group { display: flex; flex-direction: column; gap: 8px; width: 100%; } .options-group label { display: flex; align-items: center; gap: 0; color: #f5f5f7; font-size: 14px; cursor: pointer; border-radius: 12px; transition: background-color 0.2s ease; overflow: hidden; } .options-group label:hover .icon-wrapper, .options-group label:hover .text-wrapper { background-color: rgba(255, 255, 255, 0.15); } .text-wrapper { padding: 8px 12px; background-color: rgba(255, 255, 255, 0.08); width: 100%; transition: background-color 0.2s ease; display: flex; align-items: center; height: 36px; box-sizing: border-box; } .options-group input[type="radio"] { display: none; } .icon-wrapper { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background-color: rgba(255, 255, 255, 0.08); } .icon-wrapper svg { width: 16px; height: 16px; fill: #ffffff; transition: fill 0.2s ease; } .options-group input[type="radio"]:checked + .icon-wrapper svg { fill: var(--theme-icon-color, var(--theme-selected-bg)); } .options-group input[type="radio"]:checked + .icon-wrapper, .options-group input[type="radio"]:checked ~ .text-wrapper { background-color: var(--theme-selected-bg); } .options-group input[type="radio"]:checked ~ .text-wrapper span { color: white; font-weight: 600; } #toggle-options { width: 100%; } /* Toggle Switch Styling */ .toggle-switch { position: relative; display: flex; align-items: center; cursor: pointer; padding: 8px 12px; border-radius: 12px; transition: background-color 0.2s ease; background-color: rgba(255, 255, 255, 0.08); width: 100%; box-sizing: border-box; } .toggle-switch:hover { background-color: rgba(255, 255, 255, 0.15); } .toggle-switch input { opacity: 0; width: 0; height: 0; } .slider { position: relative; display: inline-block; min-width: 40px; height: 22px; background-color: rgba(255, 255, 255, 0.2); border-radius: 34px; transition: .4s; margin-right: 10px; flex-shrink: 0; } .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: white; border-radius: 50%; transition: .4s; } .toggle-switch input:checked + .slider { background-color: var(--theme-icon-color, #00bfa5); } .toggle-switch input:checked + .slider:before { transform: translateX(18px); } .toggle-label { color: #f5f5f7; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; } .toggle-switch input:checked ~ .toggle-label { font-weight: 600; } /* Add a subtle glow effect when checked */ .toggle-switch input:checked + .slider { box-shadow: 0 0 8px rgba(var(--theme-glow-rgb, 0, 191, 165), 0.6); } /* --- MANUAL ANSWER BOX --- */ #manual-answer-box { position: fixed; top: 20px; right: 20px; z-index: 10001; background-color: rgba(28, 28, 30, 0.95); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); color: #f5f5f7; padding: 16px 20px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); font-size: 16px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; opacity: 0; transform: translateY(-10px) scale(0.95); pointer-events: none; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); max-width: 400px; line-height: 1.5; } #manual-answer-box.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; } #manual-answer-box .close-button { position: absolute; top: 8px; right: 12px; background: rgba(255, 255, 255, 0.1); border: none; color: #8e8e93; font-size: 18px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; line-height: 1; } #manual-answer-box .close-button:hover { color: #f5f5f7; background: rgba(255, 255, 255, 0.2); transform: scale(1.1); } /* --- Loading Bar --- */ #auto-answer-loading-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background-color: rgba(255, 255, 255, 0.3); display: none; /* Hidden by default */ border-radius: 0 0 12px 12px; overflow: hidden; } #auto-answer-loading-bar-fill { width: 0%; /* Starts at 0 width */ height: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.8) ); border-radius: 0 0 12px 12px; transition: width 0.4s ease-in-out; /* Animate the width change */ box-shadow: 0 0 8px rgba(255, 255, 255, 0.5); background-size: 200% 100%; animation: loading-shimmer 2s ease-in-out infinite; } @keyframes loading-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } /* Show the bar when the button has the 'loading' class */ #auto-answer-button.loading #auto-answer-loading-bar { display: block; } /* Options divider styling */ .options-divider { height: 1px; background-color: rgba(255, 255, 255, 0.1); margin: 8px 0; }