- {hasMessages ? (
+ const suggestions = [
+ {
+ id: 1,
+ icon: "eco",
+ iconFilled: true,
+ color: "--color-accent-green",
+ colorBg: "--color-accent-green-bg",
+ keywords: ["photosynthesis"],
+ text: "Explain how ",
+ textEnd: " works in simple terms",
+ },
+ {
+ id: 2,
+ icon: "calculate",
+ iconFilled: false,
+ color: "--color-accent-blue",
+ colorBg: "--color-accent-blue-bg",
+ keywords: ["derivatives"],
+ text: "Help me understand ",
+ textEnd: " in calculus",
+ },
+ {
+ id: 3,
+ icon: "account_balance",
+ iconFilled: false,
+ color: "--color-accent-orange",
+ colorBg: "--color-accent-orange-bg",
+ keywords: ["Industrial"],
+ text: "What caused the ",
+ textEnd: " Revolution?",
+ },
+ {
+ id: 4,
+ icon: "edit",
+ iconFilled: true,
+ color: "--color-accent-purple",
+ colorBg: "--color-accent-purple-bg",
+ keywords: ["Romeo and Juliet"],
+ text: "Help me analyze themes in ",
+ textEnd: "",
+ },
+ ];
+
+ const fullPromptTexts = suggestions.map((s) => s.text + s.keywords.join(" ") + s.textEnd);
+
+ if (hasMessages) {
+ return (
+
{messages.map((message) => (
))}
- ) : (
-
-
-
- Welcome to padhLe
-
-
- Your AI tutor for grades 6–12. Ask anything!
-
+
+ );
+ }
-
- {suggestedPrompts.map((prompt, index) => (
-
- ))}
-
+ return (
+
+
+ {/* Welcome Header */}
+
+
+ menu_book
+ auto_awesome
+
+
Welcome to padhle
+
Your AI tutor for grades 6–12. Ask anything!
+
+
+ {/* Bento Grid Suggestions */}
+
+ {suggestions.map((suggestion) => {
+ const colorVar = suggestion.color.replace("--", "var(");
+ const bgColorVar = suggestion.colorBg.replace("--", "var(");
+
+ return (
+
+ );
+ })}
+
+
+ {/* Info Panel */}
+
+
+ lightbulb
+
+
+
Focused on your learning
+
+ I'll answer questions related to your selected subject and chapter
+
+ using your textbook content.
+
- )}
+
);
};
diff --git a/frontend/src/components/chat-input/ChatInput.css b/frontend/src/components/chat-input/ChatInput.css
index 49a8914..b81c6c8 100644
--- a/frontend/src/components/chat-input/ChatInput.css
+++ b/frontend/src/components/chat-input/ChatInput.css
@@ -1,145 +1,165 @@
/* ========================================
- ChatInput Component — padhLe (Bauhaus)
+ ChatInput Component — padhle (Refined Workspace)
======================================== */
+/* Main Input Bar */
.chat-input {
- padding: var(--spacing-md) 0;
- border-top: var(--border-thick);
- background-color: var(--color-surface);
- box-shadow: 0 -4px 0 0px var(--color-outline);
+ flex-shrink: 0;
+ width: 100%;
+ /* Gradient fade from background */
+ background: linear-gradient(to top, var(--color-background) 50%, transparent);
+ padding-top: 24px;
+ padding-bottom: 32px;
+ padding-left: 24px;
+ padding-right: 24px;
+ display: flex;
+ justify-content: center;
}
-.chat-input__wrapper {
- max-width: 900px;
- margin: 0 auto;
- padding: var(--spacing-md) var(--spacing-lg);
+/* Container — centered content */
+.chat-input__container {
+ width: 100%;
+ max-width: 800px;
}
-/* Form Container */
+/* Form */
.chat-input__form {
display: flex;
align-items: flex-end;
- gap: var(--spacing-sm);
- border: var(--border-thick);
- border-radius: var(--border-radius);
- padding: var(--spacing-sm);
- background-color: var(--color-surface);
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ gap: 8px;
+ padding: 8px;
+ border: var(--border-thin);
+ border-radius: 32px;
+ background-color: var(--color-surface-lowest);
+ box-shadow: var(--shadow-input);
+ transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.chat-input__form:focus-within {
- box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15), var(--shadow-brutal-sm);
border-color: var(--color-primary);
+ box-shadow: var(--shadow-input-focus);
}
-/* Attachments */
-.chat-input__attachments {
- display: flex;
- align-items: center;
- gap: var(--spacing-xs);
- padding-bottom: 2px;
-}
-
+/* Attachment Button */
.chat-input__attach-btn {
display: flex;
align-items: center;
justify-content: center;
- width: 38px;
- height: 38px;
- border: var(--border-medium);
- border-radius: var(--border-radius);
- background: transparent;
+ width: 44px;
+ height: 44px;
+ border: var(--border-thin);
+ border-radius: 50%;
+ background-color: var(--color-surface-lowest);
cursor: pointer;
- color: var(--color-text-variant);
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
-}
-
-.chat-input__attach-btn:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-1px);
-}
-
-/* Textarea Field */
-.chat-input__field {
- flex: 1;
- font-family: var(--font-body);
- font-size: 1rem;
- font-weight: 600;
- line-height: 1.5;
- color: var(--color-text);
- background-color: transparent;
- border: none;
- padding: var(--spacing-sm);
- resize: none;
- outline: none;
- min-height: 24px;
- max-height: 200px;
- text-transform: uppercase;
- letter-spacing: 0.03em;
-}
-
-.chat-input__field::placeholder {
- color: var(--color-text-variant);
- opacity: 0.6;
-}
-
-/* Send Button */
-.chat-input__submit {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 42px;
- height: 42px;
- border: var(--border-medium);
- border-radius: var(--border-radius);
- background: transparent;
- cursor: not-allowed;
- color: var(--color-text-variant);
- box-shadow: var(--shadow-brutal-sm);
- opacity: 0.4;
- transition: all var(--transition-fast);
+ color: var(--color-on-surface-variant);
+ transition: background-color var(--transition-fast), color var(--transition-fast);
flex-shrink: 0;
}
-.chat-input__submit--active {
+.chat-input__attach-btn:hover {
+ background-color: var(--color-surface-low);
+ color: var(--color-primary);
+}
+
+.chat-input__attach-btn .material-symbols-outlined {
+ font-size: 20px;
+ line-height: 1;
+}
+
+/* Textarea */
+.chat-input__field {
+ flex: 1;
+ font-family: var(--font-body);
+ font-size: 15px;
+ font-weight: var(--font-weight-regular);
+ line-height: 1.5;
+ color: var(--color-primary);
+ background-color: transparent;
+ border: none;
+ padding: 8px 4px;
+ resize: none;
+ outline: none;
+ min-height: 44px;
+ max-height: 128px;
+}
+
+.chat-input__field::placeholder {
+ color: var(--color-outline);
+ font-weight: var(--font-weight-regular);
+}
+
+/* Actions Container */
+.chat-input__actions {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ flex-shrink: 0;
+}
+
+/* Mic Button */
+.chat-input__mic-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 36px;
+ height: 36px;
+ border: none;
+ border-radius: 50%;
+ background: transparent;
+ cursor: pointer;
+ color: var(--color-on-surface-variant);
+ transition: background-color var(--transition-fast), color var(--transition-fast);
+ flex-shrink: 0;
+}
+
+.chat-input__mic-btn:hover {
+ background-color: var(--color-surface-low);
+ color: var(--color-primary);
+}
+
+.chat-input__mic-btn .material-symbols-outlined {
+ font-size: 20px;
+ line-height: 1;
+}
+
+/* Send Button */
+.chat-input__send-btn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 40px;
+ height: 40px;
+ border: none;
+ border-radius: 50%;
+ background: transparent;
+ cursor: not-allowed;
+ color: var(--color-on-surface-variant);
+ opacity: 0.3;
+ transition: opacity var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast);
+ flex-shrink: 0;
+}
+
+.chat-input__send-btn--active {
background-color: var(--color-primary);
color: var(--color-on-primary);
- border-color: var(--color-outline);
cursor: pointer;
opacity: 1;
}
-.chat-input__submit--active:hover {
- transform: translateY(-2px);
- box-shadow: var(--shadow-brutal);
+.chat-input__send-btn--active:hover {
+ opacity: 0.9;
}
-.chat-input__submit--active:active {
- transform: translateY(2px);
- box-shadow: none;
+.chat-input__send-btn .material-symbols-outlined {
+ font-size: 20px;
+ line-height: 1;
}
/* Disclaimer */
.chat-input__disclaimer {
- font-family: var(--font-heading);
- font-size: 0.65rem;
- font-weight: 800;
- text-transform: uppercase;
- letter-spacing: 0.1em;
- color: var(--color-text-variant);
- text-align: center;
- margin-top: var(--spacing-md);
- padding: var(--spacing-xs) var(--spacing-sm);
- border: var(--border-medium);
- border-radius: var(--border-radius);
- display: inline-block;
- background-color: var(--color-surface);
- box-shadow: var(--shadow-brutal-sm);
-}
-
-.chat-input__disclaimer-wrapper {
+ font-size: var(--font-size-label-sm);
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface-variant);
text-align: center;
+ margin-top: 12px;
}
diff --git a/frontend/src/components/chat-input/ChatInput.jsx b/frontend/src/components/chat-input/ChatInput.jsx
index af5633c..52ed5c9 100644
--- a/frontend/src/components/chat-input/ChatInput.jsx
+++ b/frontend/src/components/chat-input/ChatInput.jsx
@@ -1,11 +1,11 @@
/* ========================================
- ChatInput Component — padhLe
+ ChatInput Component — padhle (Refined Workspace)
======================================== */
import { useState, useRef, useEffect } from "react";
import "./ChatInput.css";
-const ChatInput = ({ onSend }) => {
+const ChatInput = ({ onSend, placeholder }) => {
const [text, setText] = useState("");
const textareaRef = useRef(null);
@@ -38,79 +38,59 @@ const ChatInput = ({ onSend }) => {
return (
-
+
{/* AI Disclaimer */}
-
-
- padhLe AI can make mistakes. Consider verifying important information.
-
-
+
+ Padhle AI can make mistakes. Consider verifying important information.
+
);
diff --git a/frontend/src/components/message/Message.css b/frontend/src/components/message/Message.css
index b6b8c8a..29a5ae4 100644
--- a/frontend/src/components/message/Message.css
+++ b/frontend/src/components/message/Message.css
@@ -1,5 +1,5 @@
/* ========================================
- Message Component — padhLe (Bauhaus)
+ Message Component — padhle (Refined Workspace)
======================================== */
/* Base Message */
@@ -20,179 +20,114 @@
}
}
-/* Alignment */
+/* --- USER MESSAGE --- */
.message--user {
align-items: flex-end;
}
-.message--assistant {
- align-items: flex-start;
-}
-
-/* --- USER MESSAGE --- */
.message--user .message__bubble {
background-color: var(--color-primary);
color: var(--color-on-primary);
- border: var(--border-thick);
- border-radius: var(--border-radius);
- padding: var(--spacing-md) var(--spacing-lg);
- max-width: 80%;
- position: relative;
- box-shadow: var(--shadow-brutal-sm);
+ border-radius: 18px 18px 4px 18px;
+ padding: 12px 16px;
+ max-width: 75%;
font-family: var(--font-body);
- font-size: 0.9rem;
- font-weight: 700;
- line-height: 1.5;
- text-transform: uppercase;
- letter-spacing: 0.03em;
-}
-
-.message--user .message__bubble::after {
- content: "";
- position: absolute;
- right: -12px;
- top: 12px;
- width: 12px;
- height: 12px;
- background-color: var(--color-primary);
- border-right: var(--border-thick);
- border-top: var(--border-thick);
- transform: rotate(45deg);
- display: none;
-}
-
-@media (min-width: 768px) {
- .message--user .message__bubble::after {
- display: block;
- }
+ font-size: 15px;
+ font-weight: var(--font-weight-regular);
+ line-height: var(--line-height-relaxed);
}
.message--user .message__text {
color: var(--color-on-primary);
}
+/* --- ASSISTANT MESSAGE --- */
+.message--assistant {
+ align-items: flex-start;
+}
+
+.message--assistant .message__bubble {
+ padding: 0;
+ max-width: 85%;
+}
+
/* --- ASSISTANT AVATAR --- */
.message__avatar {
display: flex;
align-items: flex-start;
- margin-right: var(--spacing-sm);
flex-shrink: 0;
+ margin-right: 8px;
margin-top: 4px;
}
.message__avatar-icon {
- width: 40px;
- height: 40px;
- border: var(--border-medium);
- border-radius: var(--border-radius);
+ width: 32px;
+ height: 32px;
+ border-radius: 50%;
background-color: var(--color-primary);
color: var(--color-on-primary);
display: flex;
align-items: center;
justify-content: center;
- box-shadow: var(--shadow-brutal-sm);
}
-/* --- ASSISTANT MESSAGE --- */
-.message--assistant .message__bubble {
- background-color: var(--color-surface);
- color: var(--color-text);
- border: var(--border-thick);
- border-radius: var(--border-radius);
- padding: var(--spacing-lg);
- max-width: 85%;
- position: relative;
- box-shadow: var(--shadow-brutal-sm);
- display: flex;
- flex-direction: column;
- gap: var(--spacing-md);
-}
-
-.message--assistant .message__bubble::before {
- content: "";
- position: absolute;
- left: -12px;
- top: 16px;
- width: 12px;
- height: 12px;
- background-color: var(--color-surface);
- border-left: var(--border-thick);
- border-top: var(--border-thick);
- transform: rotate(45deg);
- display: none;
-}
-
-@media (min-width: 768px) {
- .message--assistant .message__bubble::before {
- display: block;
- }
+.message__avatar-icon .material-symbols-outlined {
+ font-size: 18px;
+ line-height: 1;
}
+/* --- MESSAGE TEXT --- */
.message__text {
- font-size: 0.95rem;
- line-height: 1.6;
+ font-size: 15px;
+ line-height: var(--line-height-relaxed);
white-space: pre-wrap;
- font-weight: 600;
+ font-weight: var(--font-weight-regular);
+ color: var(--color-on-surface);
}
.message--assistant .message__text {
- color: var(--color-text);
- text-transform: uppercase;
- letter-spacing: 0.02em;
+ color: var(--color-on-surface);
}
/* --- ACTION BUTTONS --- */
.message__actions {
display: flex;
align-items: center;
- gap: var(--spacing-xs);
- margin-top: var(--spacing-sm);
- flex-wrap: wrap;
+ gap: 8px;
+ margin-top: 8px;
+ margin-bottom: 8px;
}
.message__action {
display: flex;
align-items: center;
- gap: 6px;
- padding: 6px var(--spacing-md);
- border: var(--border-medium);
- border-radius: var(--border-radius);
- background-color: var(--color-surface);
+ justify-content: center;
+ width: 32px;
+ height: 32px;
+ border: none;
+ border-radius: 50%;
+ background-color: var(--color-surface-low);
cursor: pointer;
- font-family: var(--font-heading);
- font-size: 0.7rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- color: var(--color-text-variant);
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ color: var(--color-on-surface-variant);
+ transition: background-color var(--transition-fast), color var(--transition-fast);
}
.message__action:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-2px);
- box-shadow: var(--shadow-brutal);
+ background-color: var(--color-surface-high);
+ color: var(--color-on-surface);
}
-.message__action:active {
- transform: translateY(2px);
- box-shadow: none;
+.message__action .material-symbols-outlined {
+ font-size: 18px;
+ line-height: 1;
}
.message__action--primary {
- background-color: var(--color-secondary);
- color: var(--color-on-secondary);
- border-color: var(--color-outline);
margin-left: auto;
-}
-
-.message__action--primary:hover {
background-color: var(--color-primary);
color: var(--color-on-primary);
}
-.message__action svg {
- flex-shrink: 0;
+.message__action--primary:hover {
+ opacity: 0.9;
}
diff --git a/frontend/src/components/message/Message.jsx b/frontend/src/components/message/Message.jsx
index bd214be..21ad7d9 100644
--- a/frontend/src/components/message/Message.jsx
+++ b/frontend/src/components/message/Message.jsx
@@ -1,5 +1,5 @@
/* ========================================
- Message Component — padhLe (Bauhaus)
+ Message Component — padhle (Refined Workspace)
======================================== */
import "./Message.css";
@@ -13,10 +13,7 @@ const Message = ({ message }) => {
{!isUser && (
)}
@@ -24,27 +21,17 @@ const Message = ({ message }) => {
{text}
- {/* Action buttons only for assistant messages */}
+ {/* Action buttons for assistant messages */}
{!isUser && (
)}
diff --git a/frontend/src/components/sidebar/Sidebar.css b/frontend/src/components/sidebar/Sidebar.css
index 16ee006..c5f5eef 100644
--- a/frontend/src/components/sidebar/Sidebar.css
+++ b/frontend/src/components/sidebar/Sidebar.css
@@ -1,5 +1,5 @@
/* ========================================
- Sidebar Component — padhLe (Bauhaus)
+ Sidebar Component — padhle (Refined Workspace)
======================================== */
/* Main Sidebar */
@@ -9,38 +9,41 @@
left: 0;
width: var(--sidebar-width);
height: 100vh;
- background-color: var(--color-surface);
- border-right: var(--border-thick);
+ background-color: var(--color-surface-lowest);
+ border-right: var(--border-thin);
display: flex;
flex-direction: column;
- padding: var(--spacing-lg);
+ padding: 24px 16px;
overflow-y: auto;
- z-index: 10;
-}
-
-.sidebar::-webkit-scrollbar {
- width: 4px;
-}
-
-.sidebar::-webkit-scrollbar-thumb {
- background-color: var(--color-outline);
- border-radius: 2px;
+ z-index: 50;
}
/* Brand */
.sidebar__brand {
- padding-bottom: var(--spacing-md);
- margin-bottom: var(--spacing-md);
- border-bottom: var(--border-medium);
+ padding: var(--spacing-sm) 8px;
+ margin-bottom: 24px;
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.sidebar__brand-inner {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.sidebar__brand-icon {
+ font-size: 28px;
+ line-height: 1;
}
.sidebar__title {
font-family: var(--font-heading);
- font-size: 2rem;
- font-weight: 800;
- text-transform: uppercase;
- letter-spacing: 0.02em;
+ font-size: var(--font-size-headline-md);
+ font-weight: var(--font-weight-bold);
color: var(--color-primary);
+ letter-spacing: -0.01em;
}
/* New Chat Button */
@@ -48,37 +51,28 @@
display: flex;
align-items: center;
justify-content: center;
- gap: var(--spacing-xs);
+ gap: 8px;
width: 100%;
- padding: var(--spacing-sm);
- border: var(--border-medium);
- border-radius: var(--border-radius);
- background-color: var(--color-surface);
- color: var(--color-text);
- font-family: var(--font-heading);
- font-size: 0.85rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.05em;
+ height: 48px;
+ border: none;
+ border-radius: var(--radius-md);
+ background-color: var(--color-primary);
+ color: var(--color-on-primary);
+ font-family: var(--font-body);
+ font-size: var(--font-size-label-md);
+ font-weight: var(--font-weight-medium);
cursor: pointer;
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
- margin-bottom: var(--spacing-lg);
+ transition: opacity var(--transition-fast);
+ margin-bottom: 24px;
}
.sidebar__new-chat:hover {
- transform: translateY(-2px);
- box-shadow: var(--shadow-brutal);
-}
-
-.sidebar__new-chat:active {
- transform: translateY(2px);
- box-shadow: none;
+ opacity: 0.9;
}
/* Section */
.sidebar__section {
- margin-bottom: var(--spacing-md);
+ margin-bottom: 20px;
}
.sidebar__section--history {
@@ -88,14 +82,13 @@
}
.sidebar__section-title {
- font-family: var(--font-heading);
- font-size: 0.7rem;
- font-weight: 800;
+ font-size: 11px;
+ font-weight: var(--font-weight-bold);
+ color: var(--color-on-surface-variant);
text-transform: uppercase;
letter-spacing: 0.1em;
- color: var(--color-text-variant);
- margin-bottom: var(--spacing-sm);
- padding-left: var(--spacing-sm);
+ padding: 0 24px;
+ margin-bottom: 8px;
}
/* Subject List */
@@ -103,54 +96,42 @@
list-style: none;
display: flex;
flex-direction: column;
- gap: 4px;
+ gap: 2px;
+ padding: 0 8px;
}
.sidebar__link {
display: flex;
align-items: center;
- gap: var(--spacing-sm);
+ gap: 12px;
width: 100%;
- padding: var(--spacing-sm);
- border: var(--border-medium);
- border-radius: var(--border-radius);
+ padding: 8px 16px;
+ border: none;
+ border-radius: var(--radius-md);
background: transparent;
cursor: pointer;
font-family: var(--font-body);
- font-size: 0.8rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.04em;
- color: var(--color-text-variant);
+ font-size: var(--font-size-label-md);
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface-variant);
text-align: left;
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ transition: background-color var(--transition-fast), color var(--transition-fast);
}
.sidebar__link:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-1px);
+ background-color: var(--color-surface-low);
}
.sidebar__link--active {
- background-color: var(--color-primary);
- color: var(--color-on-primary);
- border-color: var(--color-outline);
-}
-
-.sidebar__link--active:hover {
- color: var(--color-on-primary);
- transform: translateY(-2px);
- box-shadow: var(--shadow-brutal);
+ background-color: var(--color-surface-low);
+ color: var(--color-primary);
+ font-weight: var(--font-weight-bold);
+ border-left: 2px solid var(--color-primary);
}
.sidebar__icon {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 20px;
- font-size: 0.95rem;
+ font-size: 20px;
+ line-height: 1;
}
/* Chat List */
@@ -158,92 +139,143 @@
list-style: none;
display: flex;
flex-direction: column;
- gap: 4px;
+ gap: 2px;
+ padding: 0 8px;
}
.sidebar__chat-link {
display: flex;
flex-direction: column;
width: 100%;
- padding: var(--spacing-sm);
- padding-left: var(--spacing-sm);
- border: var(--border-medium);
- border-radius: var(--border-radius);
+ padding: 8px 16px;
+ border: none;
+ border-radius: var(--radius-md);
background: transparent;
cursor: pointer;
font-family: var(--font-body);
text-align: left;
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ transition: background-color var(--transition-fast);
}
.sidebar__chat-link:hover {
- background-color: var(--color-surface-variant);
- transform: translateY(-1px);
+ background-color: var(--color-surface-low);
}
.sidebar__chat-link--active {
- background-color: var(--color-surface-container);
- box-shadow: var(--shadow-brutal);
+ background-color: var(--color-surface-low);
}
.sidebar__chat-preview {
- font-family: var(--font-body);
- font-size: 0.8rem;
- font-weight: 700;
- color: var(--color-text);
+ font-size: 13px;
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar__chat-time {
- font-family: var(--font-body);
- font-size: 0.65rem;
- font-weight: 700;
- text-transform: uppercase;
- color: var(--color-text-variant);
- margin-top: 4px;
+ font-size: 11px;
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface-variant);
+ margin-top: 2px;
}
/* Footer */
.sidebar__footer {
display: flex;
flex-direction: column;
- gap: 4px;
- padding-top: var(--spacing-sm);
- border-top: var(--border-medium);
- margin-top: auto;
+ gap: 2px;
+ padding-top: 16px;
+ border-top: var(--border-thin);
}
.sidebar__footer-btn {
display: flex;
align-items: center;
- gap: var(--spacing-sm);
+ gap: 12px;
width: 100%;
- padding: var(--spacing-sm);
- border: var(--border-medium);
- border-radius: var(--border-radius);
+ padding: 8px 16px;
+ border: none;
+ border-radius: var(--radius-md);
background: transparent;
cursor: pointer;
font-family: var(--font-body);
- font-size: 0.75rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.04em;
- color: var(--color-text-variant);
+ font-size: 13px;
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface-variant);
text-align: left;
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ text-decoration: none;
+ transition: background-color var(--transition-fast), color var(--transition-fast);
}
.sidebar__footer-btn:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-1px);
+ background-color: var(--color-surface-low);
+ color: var(--color-on-surface);
}
-.sidebar__footer-btn:active {
- transform: translateY(2px);
- box-shadow: none;
+.sidebar__footer-icon {
+ font-size: 20px;
+ line-height: 1;
+}
+
+/* Upgrade to Pro Card */
+.sidebar__upgrade {
+ margin-top: 16px;
+ padding: 0 8px;
+}
+
+.sidebar__upgrade-inner {
+ border: var(--border-thin);
+ border-radius: var(--radius-lg);
+ padding: 16px;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ position: relative;
+ cursor: pointer;
+ transition: border-color var(--transition-fast);
+}
+
+.sidebar__upgrade:hover {
+ border-color: var(--color-outline);
+}
+
+.sidebar__upgrade-header {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.sidebar__upgrade-icon {
+ font-size: 14px;
+ line-height: 1;
+}
+
+.sidebar__upgrade-title {
+ font-size: 13px;
+ font-weight: var(--font-weight-bold);
+ color: var(--color-on-surface);
+}
+
+.sidebar__upgrade-text {
+ font-size: 11px;
+ line-height: 1.4;
+ color: var(--color-on-surface-variant);
+ padding-right: 24px;
+}
+
+.sidebar__upgrade-arrow {
+ position: absolute;
+ right: 8px;
+ top: 50%;
+ transform: translateY(-50%);
+ font-size: 20px;
+ line-height: 1;
+ color: var(--color-on-surface-variant);
+ transition: color var(--transition-fast);
+}
+
+.sidebar__upgrade:hover .sidebar__upgrade-arrow {
+ color: var(--color-primary);
}
diff --git a/frontend/src/components/sidebar/Sidebar.jsx b/frontend/src/components/sidebar/Sidebar.jsx
index c29edc2..78ca001 100644
--- a/frontend/src/components/sidebar/Sidebar.jsx
+++ b/frontend/src/components/sidebar/Sidebar.jsx
@@ -1,52 +1,53 @@
/* ========================================
- Sidebar Component — padhLe
+ Sidebar Component — padhle (Refined Workspace)
======================================== */
import "./Sidebar.css";
const Sidebar = ({ activeSubject, onSubjectChange, activeChat, onChatSelect }) => {
const subjects = [
- { id: "math", name: "Mathematics", icon: "∑" },
- { id: "science", name: "Science", icon: "⚡" },
- { id: "history", name: "History", icon: "📜" },
- { id: "language", name: "Language Arts", icon: "✍" },
- { id: "english", name: "English", icon: "📖" },
- { id: "geography", name: "Geography", icon: "🌍" },
+ { id: "math", name: "Mathematics", icon: "functions" },
+ { id: "science", name: "Science", icon: "science" },
+ { id: "history", name: "History", icon: "account_balance" },
+ { id: "language", name: "Language Arts", icon: "menu_book" },
+ { id: "english", name: "English", icon: "forum" },
+ { id: "geography", name: "Geography", icon: "public" },
];
const chats = [
{ id: 1, preview: "Explain photosynthesis", time: "Today, 10:42 AM" },
{ id: 2, preview: "Help with integrals", time: "Yesterday, 3:15 PM" },
+ { id: 3, preview: "What is cell respiration?", time: "Yesterday, 11:08 AM" },
+ { id: 4, preview: "Newton's laws of motion", time: "May 18, 6:20 PM" },
];
return (
);
diff --git a/frontend/src/components/top-nav/TopNav.css b/frontend/src/components/top-nav/TopNav.css
index 0206406..4ca7df5 100644
--- a/frontend/src/components/top-nav/TopNav.css
+++ b/frontend/src/components/top-nav/TopNav.css
@@ -1,95 +1,208 @@
/* ========================================
- TopNav Component — padhLe (Bauhaus)
+ TopNav Component — padhle (Refined Workspace)
======================================== */
+/* Main Header */
.topnav {
display: flex;
align-items: center;
justify-content: space-between;
- padding: var(--spacing-sm) var(--spacing-lg);
- border-bottom: var(--border-thick);
- background-color: var(--color-surface);
+ width: 100%;
+ height: 64px;
+ padding: 0 32px;
position: sticky;
top: 0;
- z-index: 5;
+ z-index: 40;
+ background-color: transparent;
}
-/* Tab List */
-.topnav__tabs {
- display: flex;
- gap: var(--spacing-xs);
-}
-
-/* Individual Tab */
-.topnav__tab {
+/* Selector Pills Container */
+.topnav__selectors {
display: flex;
align-items: center;
- gap: var(--spacing-xs);
- padding: var(--spacing-sm) var(--spacing-md);
- border: var(--border-medium);
- border-radius: var(--border-radius);
- background: transparent;
+ gap: 12px;
+}
+
+/* Selector Wrapper */
+.topnav__selector {
+ flex-shrink: 0;
+ position: relative;
+}
+
+/* Pill Button */
+.topnav__pill {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 6px 12px;
+ border: var(--border-thin);
+ border-radius: var(--radius-md);
+ background-color: var(--color-surface-lowest);
cursor: pointer;
- font-family: var(--font-heading);
- font-size: 0.8rem;
- font-weight: 700;
- text-transform: uppercase;
- letter-spacing: 0.06em;
- color: var(--color-text-variant);
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ font-family: var(--font-body);
+ font-size: var(--font-size-label-md);
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface);
+ transition: background-color var(--transition-fast), border-color var(--transition-fast);
+ white-space: nowrap;
}
-.topnav__tab:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-2px);
+.topnav__pill:hover {
+ background-color: var(--color-surface-low);
}
-.topnav__tab--active {
- background-color: var(--color-primary);
- color: var(--color-on-primary);
+.topnav__pill--dropdown:hover {
border-color: var(--color-outline);
}
-.topnav__tab--active:hover {
- color: var(--color-on-primary);
- transform: translateY(-2px);
- box-shadow: var(--shadow-brutal);
+/* Pill Open State */
+.topnav__pill--open {
+ background-color: var(--color-surface-low);
+ border-color: var(--color-outline);
}
-.topnav__icon {
- font-size: 1rem;
+.topnav__pill--open .topnav__pill-arrow {
+ transform: rotate(180deg);
}
-.topnav__label {
- font-family: var(--font-heading);
+.topnav__pill-icon {
+ font-size: 16px;
+ line-height: 1;
}
-/* Action Buttons (Search, Notifications) */
+.topnav__pill-label {
+ font-size: 13px;
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface);
+}
+
+.topnav__pill-arrow {
+ font-size: 16px;
+ line-height: 1;
+ color: var(--color-on-surface);
+ opacity: 0.6;
+ transition: transform var(--transition-fast);
+}
+
+/* Dropdown Menu */
+.topnav__dropdown {
+ position: absolute;
+ top: calc(100% + 6px);
+ left: 0;
+ min-width: 200px;
+ max-height: 320px;
+ overflow-y: auto;
+ border: var(--border-thin);
+ border-radius: var(--radius-md);
+ background-color: var(--color-surface-lowest);
+ box-shadow: var(--shadow-card-hover);
+ z-index: 100;
+ padding: 6px 0;
+ list-style: none;
+}
+
+/* Dropdown Items */
+.topnav__dropdown-item {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ width: 100%;
+ padding: 10px 16px;
+ border: none;
+ background: none;
+ cursor: pointer;
+ font-family: var(--font-body);
+ font-size: var(--font-size-label-md);
+ font-weight: var(--font-weight-medium);
+ color: var(--color-on-surface);
+ text-align: left;
+ transition: background-color var(--transition-fast), color var(--transition-fast);
+ white-space: nowrap;
+ position: relative;
+}
+
+.topnav__dropdown-item:hover {
+ background-color: var(--color-surface-low);
+}
+
+.topnav__dropdown-item--active {
+ color: var(--color-primary);
+ font-weight: var(--font-weight-bold);
+}
+
+.topnav__dropdown-item--active::after {
+ content: "";
+ position: absolute;
+ right: 12px;
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background-color: var(--color-primary);
+}
+
+.topnav__dropdown-icon {
+ font-size: 18px;
+ line-height: 1;
+ color: var(--color-on-surface-variant);
+}
+
+.topnav__dropdown-item:hover .topnav__dropdown-icon {
+ color: var(--color-primary);
+}
+
+/* Actions Container */
.topnav__actions {
display: flex;
align-items: center;
- gap: var(--spacing-xs);
+ gap: 8px;
+ color: var(--color-on-surface-variant);
}
+/* Action Buttons */
.topnav__action {
display: flex;
align-items: center;
justify-content: center;
- width: 36px;
- height: 36px;
- border: var(--border-medium);
- border-radius: var(--border-radius);
+ width: 40px;
+ height: 40px;
+ border: none;
+ border-radius: 50%;
background: transparent;
cursor: pointer;
- color: var(--color-text-variant);
- box-shadow: var(--shadow-brutal-sm);
- transition: all var(--transition-fast);
+ color: var(--color-on-surface-variant);
+ transition: background-color var(--transition-fast), color var(--transition-fast);
}
.topnav__action:hover {
- background-color: var(--color-surface-variant);
- color: var(--color-text);
- transform: translateY(-2px);
+ background-color: var(--color-surface-low);
+ color: var(--color-primary);
+}
+
+.topnav__action .material-symbols-outlined {
+ font-size: 22px;
+ line-height: 1;
+}
+
+/* User Avatar */
+.topnav__avatar {
+ width: 32px;
+ height: 32px;
+ border-radius: 50%;
+ border: var(--border-thin);
+ background-color: var(--color-surface-low);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ cursor: pointer;
+ transition: background-color var(--transition-fast);
+}
+
+.topnav__avatar:hover {
+ background-color: var(--color-surface-lowest);
+}
+
+.topnav__avatar-initial {
+ font-size: 13px;
+ font-weight: var(--font-weight-medium);
+ color: var(--color-primary);
}
diff --git a/frontend/src/components/top-nav/TopNav.jsx b/frontend/src/components/top-nav/TopNav.jsx
index 8bacee0..a09d466 100644
--- a/frontend/src/components/top-nav/TopNav.jsx
+++ b/frontend/src/components/top-nav/TopNav.jsx
@@ -1,47 +1,202 @@
/* ========================================
- TopNav Component — padhLe
+ TopNav Component — padhle (Refined Workspace)
======================================== */
+import { useState, useRef, useEffect } from "react";
import "./TopNav.css";
-const TopNav = ({ activeTab, onTabChange }) => {
- const tabs = [
- { id: "chat", label: "AI Chat", icon: "💬" },
- { id: "study", label: "Study Guides", icon: "📖" },
- { id: "progress", label: "Progress", icon: "📊" },
+const TopNav = ({ activeGrade, onGradeChange, activeSubject, onSubjectChange, activeChapter, onChapterChange }) => {
+ const [openDropdown, setOpenDropdown] = useState(null);
+ const gradeRef = useRef(null);
+ const subjectRef = useRef(null);
+ const chapterRef = useRef(null);
+
+ // Close dropdown when clicking outside
+ useEffect(() => {
+ const handleClickOutside = (e) => {
+ const refs = [gradeRef, subjectRef, chapterRef];
+ const isInside = refs.some((ref) => ref.current && ref.current.contains(e.target));
+ if (!isInside) {
+ setOpenDropdown(null);
+ }
+ };
+ document.addEventListener("mousedown", handleClickOutside);
+ return () => document.removeEventListener("mousedown", handleClickOutside);
+ }, []);
+
+ const toggleDropdown = (name) => {
+ setOpenDropdown((prev) => (prev === name ? null : name));
+ };
+
+ const selectOption = (name, value) => {
+ setOpenDropdown(null);
+ switch (name) {
+ case "grade":
+ onGradeChange(value);
+ break;
+ case "subject":
+ onSubjectChange(value);
+ break;
+ case "chapter":
+ onChapterChange(value);
+ break;
+ }
+ };
+
+ const grades = [
+ { id: "choose-standard", label: "Choose standard" },
+ { id: "Grade 6", label: "Grade 6" },
+ { id: "Grade 7", label: "Grade 7" },
+ { id: "Grade 8", label: "Grade 8" },
+ { id: "Grade 9", label: "Grade 9" },
+ { id: "Grade 10", label: "Grade 10" },
+ { id: "Grade 11", label: "Grade 11" },
+ { id: "Grade 12", label: "Grade 12" },
];
+ const subjects = [
+ { id: "choose-subject", label: "Choose Subject" },
+ { id: "math", label: "Mathematics" },
+ { id: "science", label: "Science" },
+ { id: "history", label: "History" },
+ { id: "language", label: "Language Arts" },
+ { id: "english", label: "English" },
+ { id: "geography", label: "Geography" },
+ ];
+
+ const chapters = [
+ { id: "choose-chapter", label: "Choose Chapter" },
+ { id: "chapter1", label: "Chapter 1: Rational Numbers" },
+ { id: "chapter2", label: "Chapter 2: Linear Equations" },
+ { id: "chapter3", label: "Chapter 3: Coordinate Geometry" },
+ { id: "chapter4", label: "Chapter 4: Life Processes" },
+ { id: "chapter5", label: "Chapter 5: Photosynthesis" },
+ { id: "chapter6", label: "Chapter 6: Human Physiology" },
+ ];
+
+ const subjectIcons = {
+ math: "calculate",
+ science: "science",
+ history: "account_balance",
+ language: "menu_book",
+ english: "edit",
+ geography: "public",
+ };
+
return (
-