/* HyzeNote Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Lexend', sans-serif;
    background-color: #0d7772;
    display: flex;
    flex-direction: column;
    padding: 20px 28px;
    color: #48C5B5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode (Default) - Teal/Turquoise Theme */
body.dark-mode {
    background-color: #0d7772;
    color: #48C5B5;
}

/* Light Mode - Light Green Theme */
body.light-mode {
    background-color: #C8E6C9;
    color: #1B5E20;
}

/* Dark Mode Panel Styles */
body.dark-mode .chat-panel,
body.dark-mode .right-panel,
body.dark-mode .settings-btn,
body.dark-mode .modal-content,
body.dark-mode .insights-btn {
    background-color: #00857C;
    color: #48C5B5;
}

body.dark-mode .logo-area span,
body.dark-mode .logo-refresh-btn span {
    color: #48C5B5;
}

body.dark-mode .settings-btn,
body.dark-mode .insights-btn {
    background-color: #00695C;
    color: #E0F2F1;
}

body.dark-mode .settings-btn:hover,
body.dark-mode .insights-btn:hover {
    background-color: #004D40;
}

body.dark-mode .chat-input {
    color: #E0F2F1;
}

body.dark-mode .chat-input::placeholder {
    color: #80CBC4;
}

body.dark-mode .message-text {
    color: #E0F2F1;
}

body.dark-mode .user-bubble {
    background-color: #26A69A;
    color: #E0F2F1;
}

body.dark-mode .user-bubble:hover {
    background-color: #00897B;
}

body.dark-mode .copy-btn {
    border-color: #48C5B5;
    color: #48C5B5;
}

body.dark-mode .copy-btn:hover {
    background-color: #00695C;
    border-color: #80CBC4;
    color: #E0F2F1;
}

body.dark-mode .chat-input-wrap {
    border-color: #48C5B5;
}

body.dark-mode .chat-input-wrap:hover,
body.dark-mode .chat-input-wrap:focus-within {
    border-color: #80CBC4;
    background-color: rgba(0, 105, 92, 0.1);
}

body.dark-mode .send-btn {
    background-color: #26A69A;
    color: #E0F2F1;
}

body.dark-mode .send-btn:hover {
    background-color: #00897B;
    transform: scale(1.05);
}

body.dark-mode .drop-zone {
    border-color: #48C5B5;
}

body.dark-mode .drop-zone:hover,
body.dark-mode .drop-zone.dragover {
    border-color: #80CBC4;
    background-color: rgba(128, 203, 196, 0.1);
}

body.dark-mode .drop-zone-text {
    color: #80CBC4;
}

body.dark-mode .code-block-wrapper {
    background: #004D40;
}

body.dark-mode .copy-code-btn {
    background: rgba(0, 105, 92, 0.8);
    color: #E0F2F1;
}

body.dark-mode .copy-code-btn:hover {
    background: rgba(0, 77, 64, 0.95);
}

body.dark-mode .command-item {
    background: rgba(0, 105, 92, 0.3);
}

body.dark-mode .command-item:hover {
    background: rgba(0, 105, 92, 0.5);
}

body.dark-mode .quiz-option {
    border-color: #48C5B5;
    color: #E0F2F1;
}

body.dark-mode .quiz-option:hover:not(.disabled) {
    background: rgba(38, 166, 154, 0.2);
    border-color: #80CBC4;
}

body.dark-mode .quiz-option.correct {
    background: #66BB6A;
    border-color: #66BB6A;
    color: white;
}

body.dark-mode .quiz-option.incorrect {
    background: #EF5350;
    border-color: #EF5350;
    color: white;
}

body.dark-mode .back-btn {
    color: #80CBC4;
}

body.dark-mode .back-btn:hover {
    color: #B2DFDB;
}

body.dark-mode .tool-title {
    color: #80CBC4;
}

body.dark-mode .note-item {
    background: rgba(0, 105, 92, 0.2);
    border-color: rgba(128, 203, 196, 0.2);
}

body.dark-mode .note-item:hover {
    background: rgba(0, 105, 92, 0.4);
    border-color: rgba(128, 203, 196, 0.4);
}

body.dark-mode .note-item.active {
    background: #00695C;
    border-color: #80CBC4;
}

body.dark-mode .note-editor textarea {
    background: rgba(0, 77, 64, 0.3);
    color: #E0F2F1;
    border-color: rgba(128, 203, 196, 0.3);
}

body.dark-mode .note-editor textarea:hover,
body.dark-mode .note-editor textarea:focus {
    background: rgba(0, 77, 64, 0.5);
    border-color: #80CBC4;
}

body.dark-mode .note-editor input {
    background: rgba(0, 77, 64, 0.3);
    color: #E0F2F1;
    border-color: rgba(128, 203, 196, 0.3);
}

body.dark-mode .note-editor input:hover,
body.dark-mode .note-editor input:focus {
    background: rgba(0, 77, 64, 0.5);
    border-color: #80CBC4;
}

body.dark-mode .empty-state {
    color: rgba(128, 203, 196, 0.6);
}

body.dark-mode .action-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

body.dark-mode .action-btn:active {
    transform: translateY(-1px);
}

body.dark-mode .add-note-btn:hover {
    background-color: #81C784;
    transform: scale(1.05);
}

body.dark-mode .save-note-btn:hover {
    background-color: #5C6BC0;
    transform: scale(1.02);
}

body.dark-mode .restart-btn:hover {
    transform: scale(1.05);
    background-color: #5C6BC0;
}

body.dark-mode .regenerate-btn:hover {
    background: #5C6BC0;
    color: white;
    border-color: #5C6BC0;
}

body.dark-mode .flashcard {
    background: rgba(0, 105, 92, 0.2);
}

body.dark-mode .flashcard:hover {
    background: rgba(0, 105, 92, 0.35);
    transform: translateY(-3px);
}

/* Light Mode Panel Styles - Green Theme */
body.light-mode .chat-panel,
body.light-mode .right-panel,
body.light-mode .settings-btn,
body.light-mode .modal-content,
body.light-mode .insights-btn {
    background-color: #E8F5E9;
    color: #1B5E20;
    box-shadow: 0 4px 20px rgba(27, 94, 32, 0.18);
}

body.light-mode .logo-area span,
body.light-mode .logo-refresh-btn span {
    color: #1B5E20;
}

body.light-mode .settings-btn,
body.light-mode .insights-btn {
    background-color: #26A69A;
    color: #FFFFFF;
}

body.light-mode .settings-btn:hover,
body.light-mode .insights-btn:hover {
    background-color: #00897B;
}

body.light-mode .chat-input {
    color: #1B5E20;
}

body.light-mode .chat-input::placeholder {
    color: #80CBC4;
}

body.light-mode .message-text {
    color: #1B5E20;
}

body.light-mode .user-bubble {
    background-color: #26A69A;
    color: #FFFFFF;
}

body.light-mode .user-bubble:hover {
    background-color: #00897B;
}

body.light-mode .copy-btn {
    border-color: #26A69A;
    color: #26A69A;
}

body.light-mode .copy-btn:hover {
    background-color: #C8E6C9;
    border-color: #00897B;
    color: #00897B;
}

body.light-mode .chat-input-wrap {
    border-color: #B2DFDB;
}

body.light-mode .chat-input-wrap:hover,
body.light-mode .chat-input-wrap:focus-within {
    border-color: #26A69A;
    background-color: rgba(178, 223, 219, 0.1);
}

body.light-mode .send-btn {
    background-color: #26A69A;
    color: #FFFFFF;
}

body.light-mode .send-btn:hover {
    background-color: #00897B;
    transform: scale(1.05);
}

body.light-mode .drop-zone {
    border-color: #66BB6A;
    background-color: rgba(200, 230, 201, 0.15);
}

body.light-mode .drop-zone:hover,
body.light-mode .drop-zone.dragover {
    border-color: #388E3C;
    background-color: rgba(200, 230, 201, 0.35);
}

body.light-mode .drop-zone-text {
    color: #26A69A;
}

body.light-mode .code-block-wrapper {
    background: #263238;
}

body.light-mode .copy-code-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

body.light-mode .copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

body.light-mode .command-item {
    background: rgba(200, 230, 201, 0.4);
}

body.light-mode .command-item:hover {
    background: rgba(200, 230, 201, 0.65);
}

body.light-mode .quiz-option {
    border-color: #A5D6A7;
    color: #1B5E20;
}

body.light-mode .quiz-option:hover:not(.disabled) {
    background: rgba(38, 166, 154, 0.1);
    border-color: #26A69A;
}

body.light-mode .quiz-option.correct {
    background: #66BB6A;
    border-color: #66BB6A;
    color: white;
}

body.light-mode .quiz-option.incorrect {
    background: #EF5350;
    border-color: #EF5350;
    color: white;
}

body.light-mode .back-btn {
    color: #26A69A;
}

body.light-mode .back-btn:hover {
    color: #00897B;
}

body.light-mode .tool-title {
    color: #1B5E20;
}

body.light-mode .note-item {
    background: rgba(200, 230, 201, 0.4);
    border-color: rgba(165, 214, 167, 0.5);
}

body.light-mode .note-item:hover {
    background: rgba(200, 230, 201, 0.65);
    border-color: rgba(102, 187, 106, 0.5);
}

body.light-mode .note-item.active {
    background: #26A69A;
    border-color: #00897B;
}

body.light-mode .note-item.active .note-name {
    color: #FFFFFF;
}

body.light-mode .note-name {
    color: #1B5E20;
}

body.light-mode .note-editor textarea {
    background: rgba(200, 230, 201, 0.25);
    color: #1B5E20;
    border-color: rgba(165, 214, 167, 0.6);
}

body.light-mode .note-editor textarea:hover,
body.light-mode .note-editor textarea:focus {
    background: rgba(200, 230, 201, 0.45);
    border-color: #66BB6A;
}

body.light-mode .note-editor input {
    background: rgba(200, 230, 201, 0.25);
    color: #1B5E20;
    border-color: rgba(165, 214, 167, 0.6);
}

body.light-mode .note-editor input:hover,
body.light-mode .note-editor input:focus {
    background: rgba(200, 230, 201, 0.45);
    border-color: #66BB6A;
}

body.light-mode .empty-state {
    color: rgba(27, 94, 32, 0.55);
}

body.light-mode .action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 105, 92, 0.25);
}

body.light-mode .action-btn:active {
    transform: translateY(-1px);
}

body.light-mode .add-note-btn:hover {
    background-color: #66BB6A;
    transform: scale(1.05);
}

body.light-mode .save-note-btn:hover {
    background-color: #5C6BC0;
    transform: scale(1.02);
}

body.light-mode .restart-btn:hover {
    transform: scale(1.05);
    background-color: #5C6BC0;
}

body.light-mode .regenerate-btn:hover {
    background: #5C6BC0;
    color: white;
    border-color: #5C6BC0;
}

body.light-mode .flashcard {
    background: rgba(200, 230, 201, 0.4);
}

body.light-mode .flashcard:hover {
    background: rgba(200, 230, 201, 0.65);
    transform: translateY(-3px);
}

body.light-mode .flashcard-front {
    color: #F57C00;
}

body.light-mode .flashcard-back {
    color: #00695C;
}

body.dark-mode .quiz-question {
    background: rgba(0, 105, 92, 0.2);
}

body.light-mode .quiz-question {
    background: rgba(200, 230, 201, 0.4);
}

body.light-mode .question-number {
    color: #F57C00;
}

body.light-mode .question-text {
    color: #1B5E20;
}

body.light-mode .guide-section {
    background: rgba(200, 230, 201, 0.4);
}

body.light-mode .guide-section h4 {
    color: #F57C00;
}

body.light-mode .guide-section p {
    color: #1B5E20;
}

body.light-mode .modal-field input,
body.light-mode .modal-field textarea {
    background: rgba(200, 230, 201, 0.3);
    color: #1B5E20;
    border-color: rgba(165, 214, 167, 0.6);
}

body.light-mode .modal-field input:hover,
body.light-mode .modal-field input:focus,
body.light-mode .modal-field textarea:hover,
body.light-mode .modal-field textarea:focus {
    background: rgba(200, 230, 201, 0.5);
    border-color: #66BB6A;
}

body.light-mode .modal-btn.primary {
    background: #26A69A;
}

body.light-mode .modal-btn.primary:hover {
    background: #00897B;
}

body.light-mode .modal-btn.secondary {
    border-color: #26A69A;
    color: #26A69A;
}

body.light-mode .modal-btn.secondary:hover {
    background: rgba(38, 166, 154, 0.1);
}

body.light-mode .sign-out-btn {
    background: #EF5350;
}

body.light-mode .sign-out-btn:hover {
    background: #E53935;
}

body.light-mode .modal-content h2 {
    color: #1B5E20;
}

body.light-mode .modal-field label {
    color: #1B5E20;
}

/* TOP BAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-shrink: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-refresh-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px 4px 4px;
    border-radius: 12px;
    transition: all 0.25s ease;
    font-family: 'Lexend', sans-serif;
}

.logo-refresh-btn:hover {
    background: rgba(72, 197, 181, 0.12);
    transform: none;
}

body.light-mode .logo-refresh-btn:hover {
    background: rgba(102, 187, 106, 0.15);
}

.logo-refresh-btn:hover .logo-refresh-icon {
    transform: rotate(360deg);
}

.logo-refresh-icon {
    transition: transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.logo-refresh-btn:active .logo-refresh-icon {
    transform: rotate(720deg);
}

.logo-area img {
    height: 36px;
    width: auto;
}

.logo-area span,
.logo-refresh-btn span {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}

.settings-btn,
.insights-btn {
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    font-size: 18px;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* MAIN LAYOUT */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* LEFT PANEL - CHAT */
.chat-panel {
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    overflow: hidden;
    transition: all 0.3s ease;
    min-height: 0;
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 12px;
    scroll-behavior: smooth;
    min-height: 0;
}

/* Global Custom Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(72, 197, 181, 0.45) transparent;
}

body.light-mode * {
    scrollbar-color: rgba(102, 187, 106, 0.5) transparent;
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #26A69A 0%, #00897B 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #80CBC4 0%, #26A69A 100%);
    background-clip: padding-box;
}

body.light-mode *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #66BB6A 0%, #388E3C 100%);
    background-clip: padding-box;
}

body.light-mode *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #A5D6A7 0%, #66BB6A 100%);
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

.messages-area::-webkit-scrollbar {
    width: 6px;
}
.messages-area::-webkit-scrollbar-track {
    background: transparent;
}
.messages-area::-webkit-scrollbar-thumb {
    background: rgba(0, 105, 92, 0.3);
    border-radius: 3px;
}

.message-bubble {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-text {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.3s ease;
    word-wrap: break-word;
}

/* Command help styling */
.command-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.command-item {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.command-name {
    font-weight: 600;
    color: #F1C232;
    margin-bottom: 2px;
}

.command-desc {
    opacity: 0.9;
    font-size: 13px;
}

/* Formatted content styles */
.message-text .katex {
    font-size: 1.1em;
}

.code-block-wrapper {
    position: relative;
    margin: 8px 0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Lexend', sans-serif;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.code-block-wrapper:hover .copy-code-btn {
    opacity: 1;
}

.message-text pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    background: transparent;
}

.message-text code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.message-text :not(pre) > code {
    background: rgba(38, 166, 154, 0.15);
    padding: 2px 5px;
    border-radius: 4px;
}

/* Markdown list styles */
.message-text ul, .summary-container ul {
    margin-left: 20px;
    margin-bottom: 15px;
    list-style-type: disc;
}

.message-text ol, .summary-container ol {
    margin-left: 20px;
    margin-bottom: 15px;
    list-style-type: decimal;
}

.message-text li, .summary-container li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.message-text h1, .message-text h2, .message-text h3,
.summary-container h1, .summary-container h2, .summary-container h3 {
    margin-bottom: 15px;
    margin-top: 20px;
    color: #F1C232;
}

.message-text h1:first-child, .message-text h2:first-child, .message-text h3:first-child,
.summary-container h1:first-child, .summary-container h2:first-child, .summary-container h3:first-child {
    margin-top: 0;
}

.message-text p, .summary-container p {
    margin-bottom: 12px;
}

.copy-btn {
    background: transparent;
    font-family: 'Lexend', sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s ease;
}

/* User message bubble (right-aligned) */
.user-bubble {
    align-self: flex-end;
    padding: 10px 15px;
    border-radius: 14px 14px 4px 14px;
    font-size: 14px;
    font-weight: 500;
    max-width: 85%;
    line-height: 1.4;
    transition: all 0.3s ease;
}

/* Bot message bubble */
.bot-bubble {
    align-self: flex-start;
    max-width: 100%;
    width: 100%;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
}

.typing-indicator.visible {
    display: flex;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    opacity: 0.5;
    animation: typingBounce 1.2s infinite;
}

body.dark-mode .typing-dot {
    background: #80CBC4;
}

body.light-mode .typing-dot {
    background: #26A69A;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* CHAT INPUT */
.chat-input-wrap {
    margin-top: 14px;
    border: 1.5px dashed;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 4px 4px 4px 14px;
    background: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.send-btn {
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lexend', sans-serif;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* RIGHT PANEL */
.right-panel {
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    overflow-y: auto;
    min-height: 0;
    position: relative;
}

.right-panel::-webkit-scrollbar-corner {
    background: transparent;
}

.buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    flex-shrink: 0;
}

.action-btn {
    padding: 16px 10px;
    border-radius: 16px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    letter-spacing: 0.1px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.action-btn i {
    font-size: 20px;
    opacity: 0.95;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-mindmap  { background: #E06666; }
.btn-quiz     { background: #E69138; }
.btn-flash    { background: #F1C232; }
.btn-summary  { background: #93C47D; }
.btn-guide    { background: #577DB7; }
.btn-notes    { background: #3470cbff;}
.btn-stories  { background: #AB47BC; }
.btn-pomodoro { background: #674EA7; }

/* DROP ZONE */
.drop-zone {
    flex: 1;
    border: 2px dashed;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
    padding: 20px;
    overflow-y: auto;
}

.drop-zone-text {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    line-height: 1.6;
    pointer-events: none;
    transition: color 0.3s ease;
    word-break: break-word;
}

.file-list {
    list-style: none;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
}

.file-list li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 105, 92, 0.1);
}

/* TOOL VIEW STYLES */
.tool-view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.tool-view.active {
    display: flex;
}

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.tool-title {
    font-size: 24px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    margin-right: 34px;
    transition: color 0.3s ease;
}

.tool-content {
    flex: 1;
    overflow-y: auto;
}

/* Loading state */
.tool-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
}

body.dark-mode .tool-loading {
    color: #80CBC4;
}

body.light-mode .tool-loading {
    color: #26A69A;
}

.tool-loading i {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.no-sources {
    text-align: center;
    padding: 40px 20px;
}

body.dark-mode .no-sources {
    color: #80CBC4;
}

body.light-mode .no-sources {
    color: #26A69A;
}

.no-sources i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* QUIZ STYLES */
.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-question {
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.question-number {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    background: transparent;
    border: 2px solid;
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'Lexend', sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-results {
    text-align: center;
    padding: 40px 20px;
}

.quiz-score {
    font-size: 48px;
    font-weight: 700;
    color: #F1C232;
    margin-bottom: 10px;
}

.quiz-message {
    font-size: 18px;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

body.dark-mode .quiz-message {
    color: #E0F2F1;
}

body.light-mode .quiz-message {
    color: #1B5E20;
}

.restart-btn {
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: 'Lexend', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .restart-btn {
    background: #577DB7;
    color: white;
}

body.light-mode .restart-btn {
    background: #5C6BC0;
    color: white;
}

/* FLASHCARD STYLES */
.flashcard-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flashcard {
    border-radius: 12px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.flashcard-front {
    font-size: 18px;
    font-weight: 600;
    color: #F1C232;
}

.flashcard-back {
    font-size: 16px;
    display: none;
    transition: color 0.3s ease;
}

body.dark-mode .flashcard-back {
    color: #E0F2F1;
}

body.light-mode .flashcard-back {
    color: #00695C;
}

.flashcard.flipped .flashcard-front {
    display: none;
}

.flashcard.flipped .flashcard-back {
    display: block;
}

.flashcard-hint {
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
    transition: color 0.3s ease;
}

body.dark-mode .flashcard-hint {
    color: #80CBC4;
}

body.light-mode .flashcard-hint {
    color: #26A69A;
}

/* RADIAL MIND MAP STYLES */
.mindmap-radial-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mindmap-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mindmap-connection {
    stroke: rgba(128, 128, 128, 0.4);
    stroke-width: 2;
    fill: none;
}

body.dark-mode .mindmap-connection {
    stroke: rgba(128, 203, 196, 0.3);
}

body.light-mode .mindmap-connection {
    stroke: rgba(0, 105, 92, 0.3);
}

.mindmap-nodes-container {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.mindmap-central-node {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #2C3E50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 15px;
    word-wrap: break-word;
    line-height: 1.3;
}

.mindmap-satellite-node {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    word-wrap: break-word;
    line-height: 1.2;
    color: #2C3E50;
}

.mindmap-satellite-node:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 20;
}

/* Vibrant colors for satellite nodes */
.mindmap-color-0 { background: #81D4FA; color: #01579B; }
.mindmap-color-1 { background: #CCFF90; color: #33691E; }
.mindmap-color-2 { background: #FFF176; color: #F57F17; }
.mindmap-color-3 { background: #E1BEE7; color: #4A148C; }
.mindmap-color-4 { background: #F48FB1; color: #880E4F; }
.mindmap-color-5 { background: #80DEEA; color: #006064; }
.mindmap-color-6 { background: #FFCC80; color: #E65100; }
.mindmap-color-7 { background: #CE93D8; color: #4A148C; }

/* SUMMARY STYLES */
.summary-container {
    border-radius: 12px;
    padding: 25px;
    line-height: 1.8;
    transition: all 0.3s ease;
}

body.dark-mode .summary-container {
    background: rgba(0, 105, 92, 0.2);
    color: #E0F2F1;
}

body.light-mode .summary-container {
    background: rgba(200, 230, 201, 0.4);
    color: #1B5E20;
}

.summary-container h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

body.dark-mode .summary-container h3 {
    color: #93C47D;
}

body.light-mode .summary-container h3 {
    color: #66BB6A;
}

/* STUDY GUIDE STYLES */
.guide-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guide-section {
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

body.dark-mode .guide-section {
    background: rgba(0, 105, 92, 0.2);
}

body.light-mode .guide-section {
    background: rgba(178, 223, 219, 0.3);
}

.guide-section h4 {
    margin-bottom: 10px;
    font-size: 16px;
    transition: color 0.3s ease;
}

body.dark-mode .guide-section h4 {
    color: #E69138;
}

body.light-mode .guide-section h4 {
    color: #F57C00;
}

.guide-section p {
    font-size: 14px;
    line-height: 1.6;
    transition: color 0.3s ease;
}

body.dark-mode .guide-section p {
    color: #E0F2F1;
}

body.light-mode .guide-section p {
    color: #004D40;
}

/* NOTES STYLES */
.notes-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 15px;
}

.notes-sidebar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.note-item {
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.delete-note {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.delete-note:hover {
    opacity: 1;
    transform: scale(1.1);
}

.add-note-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .add-note-btn {
    background: #93C47D;
    color: white;
}

body.light-mode .add-note-btn {
    background: #66BB6A;
    color: white;
}

/* Note drop zone (inside notes view) */
.note-drop-zone {
    border: 2px dashed;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

body.dark-mode .note-drop-zone {
    border-color: #60dd47;
    color: #80CBC4;
}

body.dark-mode .note-drop-zone:hover,
body.dark-mode .note-drop-zone.dragover {
    border-color: #80CBC4;
    background: rgba(128, 203, 196, 0.1);
}

body.light-mode .note-drop-zone {
    border-color: #26A69A;
    color: #26A69A;
}

body.light-mode .note-drop-zone:hover,
body.light-mode .note-drop-zone.dragover {
    border-color: #00897B;
    background: rgba(178, 223, 219, 0.2);
}

.note-drop-zone i {
    font-size: 28px;
    margin-bottom: 8px;
}

.note-source-list {
    margin-top: 8px;
    font-size: 13px;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
}

.note-source-item {
    padding: 2px 0;
    transition: color 0.3s ease;
}

body.dark-mode .note-source-item {
    color: #B2DFDB;
}

body.light-mode .note-source-item {
    color: #00695C;
}

.note-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-editor input {
    border: 1.5px solid;
    border-radius: 10px;
    padding: 12px 15px;
    font-family: 'Lexend', sans-serif;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.note-editor input:focus {
    outline: none;
}

.note-editor textarea {
    flex: 1;
    border: 1.5px solid;
    border-radius: 10px;
    padding: 15px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    resize: none;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.note-editor textarea:focus {
    outline: none;
}

.save-note-btn {
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .save-note-btn {
    background: #577DB7;
    color: white;
}

body.light-mode .save-note-btn {
    background: #5C6BC0;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.7;
    transition: color 0.3s ease;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

/* CONFETTI CANVAS */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
    transition: color 0.3s ease;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.modal-field input,
.modal-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Theme toggle switch */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.toggle-switch {
    position: relative;
    width: 56px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(28px);
}

body.dark-mode .toggle-track {
    background-color: #26A69A;
}

body.light-mode .toggle-track {
    background-color: #66BB6A;
}

/* AI disclaimer notice */
.ai-disclaimer {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 4px;
}

body.dark-mode .ai-disclaimer {
    background: rgba(241, 194, 50, 0.12);
    border: 1px solid rgba(241, 194, 50, 0.3);
    color: #ffe082;
}

body.light-mode .ai-disclaimer {
    background: rgba(245, 124, 0, 0.08);
    border: 1px solid rgba(245, 124, 0, 0.25);
    color: #e65100;
}

/* Footer info in settings */
.settings-footer {
    text-align: center;
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.65;
}

/* Terms button */
.terms-btn {
    background: transparent;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: opacity 0.2s ease;
}

.terms-btn:hover { opacity: 0.75; }

body.dark-mode .terms-btn { color: #80CBC4; }
body.light-mode .terms-btn { color: #388E3C; }

/* Terms modal */
.terms-modal-content {
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

body.dark-mode .terms-modal-content {
    background-color: #00857C;
    color: #E0F2F1;
}

body.light-mode .terms-modal-content {
    background-color: #E8F5E9;
    color: #1B5E20;
}

.terms-modal-content h2 {
    font-size: 22px;
    margin-bottom: 18px;
    text-align: center;
}

.terms-modal-content h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 16px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.terms-modal-content p {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.terms-close-btn {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 12px;
    border-radius: 30px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-mode .terms-close-btn {
    background: #26A69A;
    color: white;
}

body.light-mode .terms-close-btn {
    background: #66BB6A;
    color: white;
}

body.dark-mode .terms-close-btn:hover { background: #00897B; }
body.light-mode .terms-close-btn:hover { background: #43A047; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.secondary {
    background: transparent;
}

.sign-out-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    transition: all 0.2s ease;
}

/* Main menu visibility */
.main-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.main-menu.hidden {
    display: none;
}

/* Regenerate button */
.regenerate-btn {
    background: transparent;
    border: 2px solid;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Lexend', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
}

body.dark-mode .regenerate-btn {
    border-color: #577DB7;
    color: #80CBC4;
}

body.light-mode .regenerate-btn {
    border-color: #5C6BC0;
    color: #5C6BC0;
}

/* Terms Splash Screen */
.splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0d7772 0%, #004D40 100%);
}

.splash-card {
    background: #00857C;
    border-radius: 28px;
    padding: 36px 32px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: splashIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes splashIn {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.splash-logo img { height: 40px; }

.splash-logo span {
    font-size: 26px;
    font-weight: 700;
    color: #48C5B5;
}

.splash-card h2 {
    text-align: center;
    color: #48C5B5;
    font-size: 18px;
    margin-bottom: 6px;
}

.splash-subtitle {
    text-align: center;
    font-size: 12px;
    color: #80CBC4;
    margin-bottom: 20px;
}

.splash-section h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #80CBC4;
    margin: 14px 0 5px;
}

.splash-section p {
    font-size: 13px;
    line-height: 1.65;
    color: #B2DFDB;
}

.splash-divider {
    height: 1px;
    background: rgba(128,203,196,0.2);
    margin: 16px 0;
}

.splash-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 20px 0 16px;
    padding: 14px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
}

.splash-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #26A69A;
    cursor: pointer;
}

.splash-checkbox-row label {
    font-size: 13px;
    color: #E0F2F1;
    line-height: 1.5;
    cursor: pointer;
}

.splash-accept-btn {
    width: 100%;
    padding: 14px;
    border-radius: 999px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #26A69A;
    color: white;
}

.splash-accept-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.splash-accept-btn:not(:disabled):hover {
    background: #00897B;
    transform: scale(1.02);
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
}

.tutorial-card {
    border-radius: 24px;
    padding: 28px 28px 22px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
    animation: slideUp 0.4s cubic-bezier(0.34,1.4,0.64,1);
    position: relative;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(60px); }
    to   { opacity: 1; transform: translateY(0); }
}

body.dark-mode .tutorial-card {
    background: #00857C;
    color: #E0F2F1;
}

body.light-mode .tutorial-card {
    background: #E8F5E9;
    color: #1B5E20;
}

.tutorial-step-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
    background: rgba(38,166,154,0.25);
    color: #80CBC4;
}

body.light-mode .tutorial-step-badge {
    background: rgba(102,187,106,0.2);
    color: #388E3C;
}

.tutorial-emoji {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.tutorial-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tutorial-card p {
    font-size: 14px;
    line-height: 1.65;
    opacity: 0.85;
    margin-bottom: 20px;
}

.tutorial-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 18px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(128,203,196,0.3);
    transition: all 0.2s ease;
}

.tutorial-dot.active {
    background: #26A69A;
    width: 22px;
    border-radius: 4px;
}

body.light-mode .tutorial-dot { background: rgba(102,187,106,0.3); }
body.light-mode .tutorial-dot.active { background: #66BB6A; }

.tutorial-actions {
    display: flex;
    gap: 10px;
}

.tutorial-next-btn {
    flex: 1;
    padding: 12px;
    border-radius: 999px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #26A69A;
    color: white;
}

body.light-mode .tutorial-next-btn { background: #66BB6A; }
.tutorial-next-btn:hover { filter: brightness(1.1); transform: scale(1.02); }

.tutorial-skip-btn {
    padding: 12px 18px;
    border-radius: 999px;
    border: none;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    opacity: 0.6;
}

body.dark-mode .tutorial-skip-btn { color: #80CBC4; }
body.light-mode .tutorial-skip-btn { color: #388E3C; }
.tutorial-skip-btn:hover { opacity: 1; }

/* Streak Badge in Topbar */
.streak-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: default;
    transition: all 0.3s ease;
}

body.dark-mode .streak-badge {
    background: rgba(241,194,50,0.15);
    color: #F1C232;
    border: 1.5px solid rgba(241,194,50,0.3);
}

body.light-mode .streak-badge {
    background: rgba(245,124,0,0.1);
    color: #E65100;
    border: 1.5px solid rgba(245,124,0,0.25);
}

/* Badges Section in Settings */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.badge-item {
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s ease;
}

body.dark-mode .badge-item {
    background: rgba(0,105,92,0.2);
}

body.light-mode .badge-item {
    background: rgba(200,230,201,0.4);
}

.badge-item.locked {
    opacity: 0.35;
    filter: grayscale(1);
}

.badge-emoji {
    font-size: 26px;
    display: block;
    margin-bottom: 4px;
}

.badge-name {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
}

body.dark-mode .badge-name { color: #80CBC4; }
body.light-mode .badge-name { color: #388E3C; }

.badge-desc {
    font-size: 9px;
    opacity: 0.7;
    margin-top: 2px;
    line-height: 1.3;
}

/* Pomodoro */
.pomodoro-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    padding: 10px;
}

.pomodoro-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.7;
}

.pomodoro-ring {
    position: relative;
    width: 180px;
    height: 180px;
}

.pomodoro-ring svg {
    transform: rotate(-90deg);
    width: 180px;
    height: 180px;
}

.pomodoro-ring circle {
    fill: none;
    stroke-width: 10;
}

.pomodoro-bg-circle {
    stroke: rgba(128,203,196,0.15);
}

body.light-mode .pomodoro-bg-circle {
    stroke: rgba(102,187,106,0.2);
}

.pomodoro-progress-circle {
    stroke: #26A69A;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

body.light-mode .pomodoro-progress-circle {
    stroke: #66BB6A;
}

.pomodoro-progress-circle.break {
    stroke: #42A5F5;
}

.pomodoro-time-display {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pomodoro-time {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
    transition: color 0.3s ease;
}

body.dark-mode .pomodoro-time { color: #E0F2F1; }
body.light-mode .pomodoro-time { color: #1B5E20; }

.pomodoro-phase-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.6;
    margin-top: 2px;
}

.pomodoro-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pomo-btn {
    border: none;
    border-radius: 999px;
    font-family: 'Lexend', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pomo-btn:hover { filter: brightness(1.1); transform: scale(1.05); }

.pomo-play-btn {
    padding: 14px 32px;
    font-size: 15px;
    background: #26A69A;
    color: white;
}

body.light-mode .pomo-play-btn { background: #66BB6A; }

.pomo-reset-btn {
    padding: 12px 20px;
    font-size: 13px;
    background: transparent;
    border: 2px solid;
}

body.dark-mode .pomo-reset-btn { border-color: #48C5B5; color: #48C5B5; }
body.light-mode .pomo-reset-btn { border-color: #66BB6A; color: #388E3C; }

.pomodoro-sessions {
    display: flex;
    gap: 8px;
}

.session-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
    transition: all 0.3s ease;
}

body.dark-mode .session-dot { border-color: #48C5B5; }
body.light-mode .session-dot { border-color: #66BB6A; }

.session-dot.filled {
    background: #26A69A;
    border-color: #26A69A;
}

body.light-mode .session-dot.filled {
    background: #66BB6A;
    border-color: #66BB6A;
}

.pomodoro-settings-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.pomo-setting-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pomo-setting-item label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

.pomo-setting-item input[type=number] {
    width: 54px;
    text-align: center;
    border-radius: 8px;
    border: 1.5px solid;
    padding: 5px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
}

body.dark-mode .pomo-setting-item input {
    border-color: rgba(128,203,196,0.4);
    color: #E0F2F1;
}

body.light-mode .pomo-setting-item input {
    border-color: rgba(102,187,106,0.5);
    color: #1B5E20;
}

.pomo-setting-item input:focus { outline: none; }

/* Stories */
.stories-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.story-card {
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    line-height: 1.75;
    font-size: 14px;
    flex: 1;
    overflow-y: auto;
}

body.dark-mode .story-card {
    background: rgba(0,105,92,0.2);
    color: #E0F2F1;
}

body.light-mode .story-card {
    background: rgba(200,230,201,0.4);
    color: #1B5E20;
}

.story-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

body.dark-mode .story-card h3 { color: #F1C232; }
body.light-mode .story-card h3 { color: #E65100; }

.story-genre-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.genre-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1.5px solid;
    font-family: 'Lexend', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

body.dark-mode .genre-btn {
    border-color: rgba(128,203,196,0.4);
    color: #80CBC4;
}

body.light-mode .genre-btn {
    border-color: rgba(102,187,106,0.5);
    color: #388E3C;
}

.genre-btn.active, .genre-btn:hover {
    background: #26A69A;
    border-color: #26A69A;
    color: white;
}

body.light-mode .genre-btn.active,
body.light-mode .genre-btn:hover {
    background: #66BB6A;
    border-color: #66BB6A;
    color: white;
}

/* Insights Button */
.insights-btn {}

/* Insights Modal */
.insights-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.insights-modal-overlay.show { display: flex; }

.insights-modal {
    border-radius: 28px;
    padding: 0;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.45);
    animation: splashIn 0.35s cubic-bezier(0.34,1.3,0.64,1);
}

body.dark-mode .insights-modal { background: #00857C; color: #E0F2F1; }
body.light-mode .insights-modal { background: #E8F5E9; color: #1B5E20; }

.insights-header {
    padding: 24px 28px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 1px solid;
}

body.dark-mode .insights-header { border-color: rgba(72,197,181,0.2); }
body.light-mode .insights-header { border-color: rgba(102,187,106,0.25); }

.insights-header h2 { font-size: 22px; font-weight: 700; }
body.dark-mode .insights-header h2 { color: #48C5B5; }
body.light-mode .insights-header h2 { color: #1B5E20; }

.insights-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
}

.insights-close-btn:hover { opacity: 1; }
body.dark-mode .insights-close-btn { color: #E0F2F1; }
body.light-mode .insights-close-btn { color: #1B5E20; }

.insights-tabs {
    display: flex;
    gap: 0;
    padding: 0 28px;
    border-bottom: 1px solid;
    flex-shrink: 0;
}

body.dark-mode .insights-tabs { border-color: rgba(72,197,181,0.15); }
body.light-mode .insights-tabs { border-color: rgba(102,187,106,0.2); }

.insights-tab {
    padding: 12px 18px;
    border: none;
    background: none;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
    opacity: 0.55;
}

body.dark-mode .insights-tab { color: #E0F2F1; }
body.light-mode .insights-tab { color: #1B5E20; }

.insights-tab.active {
    opacity: 1;
    border-bottom-color: #9C27B0;
}

.insights-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.insights-section { display: none; }
.insights-section.active { display: block; }

/* Goals */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.goal-item {
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}

body.dark-mode .goal-item { background: rgba(0,105,92,0.25); }
body.light-mode .goal-item { background: rgba(200,230,201,0.5); }

.goal-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.goal-ring svg { transform: rotate(-90deg); width: 52px; height: 52px; }
.goal-ring circle { fill: none; stroke-width: 5; }

.goal-ring-bg { stroke: rgba(128,128,128,0.2); }
body.dark-mode .goal-ring-track { stroke: #26A69A; }
body.light-mode .goal-ring-track { stroke: #66BB6A; }

.goal-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

body.dark-mode .goal-ring-center { color: #E0F2F1; }
body.light-mode .goal-ring-center { color: #1B5E20; }

.goal-info { flex: 1; }
.goal-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.goal-subtext { font-size: 12px; opacity: 0.6; }

.goal-check {
    font-size: 20px;
    transition: all 0.2s ease;
}

.add-goal-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.goal-input {
    flex: 1;
    border-radius: 10px;
    border: 1.5px solid;
    padding: 9px 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    background: transparent;
    transition: all 0.2s ease;
}

body.dark-mode .goal-input { border-color: rgba(72,197,181,0.35); color: #E0F2F1; }
body.light-mode .goal-input { border-color: rgba(102,187,106,0.45); color: #1B5E20; }
.goal-input:focus { outline: none; }
body.dark-mode .goal-input:focus { border-color: #26A69A; }
body.light-mode .goal-input:focus { border-color: #66BB6A; }

.goal-type-select {
    border-radius: 10px;
    border: 1.5px solid;
    padding: 9px 10px;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    background: transparent;
    cursor: pointer;
}

body.dark-mode .goal-type-select { border-color: rgba(72,197,181,0.35); color: #E0F2F1; background: #006860; }
body.light-mode .goal-type-select { border-color: rgba(102,187,106,0.45); color: #1B5E20; background: #C8E6C9; }

.add-goal-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #9C27B0;
    color: white;
}

.add-goal-btn:hover { background: #7B1FA2; }

/* Progress Dashboard */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

body.dark-mode .stat-card { background: rgba(0,105,92,0.25); }
body.light-mode .stat-card { background: rgba(200,230,201,0.5); }

.stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

body.dark-mode .stat-number { color: #48C5B5; }
body.light-mode .stat-number { color: #388E3C; }

.stat-label { font-size: 12px; opacity: 0.65; font-weight: 600; }

.progress-bar-row {
    margin-bottom: 14px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.8;
}

.progress-bar-track {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}

body.dark-mode .progress-bar-track { background: rgba(72,197,181,0.15); }
body.light-mode .progress-bar-track { background: rgba(102,187,106,0.2); }

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.34,1.3,0.64,1);
}

/* Weak Spots */
.weak-spot-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weak-spot-item {
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

body.dark-mode .weak-spot-item { background: rgba(0,105,92,0.2); }
body.light-mode .weak-spot-item { background: rgba(200,230,201,0.4); }

.weak-spot-icon {
    font-size: 20px;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.weak-spot-info { flex: 1; }
.weak-spot-topic { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.weak-spot-stat { font-size: 12px; opacity: 0.6; }

.weak-spot-bar {
    width: 60px;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

body.dark-mode .weak-spot-bar { background: rgba(72,197,181,0.15); }
body.light-mode .weak-spot-bar { background: rgba(102,187,106,0.2); }

.weak-spot-fill { height: 100%; border-radius: 999px; background: #EF5350; }

.insights-empty {
    text-align: center;
    padding: 40px 20px;
    opacity: 0.55;
    font-size: 14px;
}

.insights-empty i { font-size: 40px; display: block; margin-bottom: 12px; }

/* Socratic Mode Banner */
.socratic-banner {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
}

.socratic-banner.active { display: flex; }

body.dark-mode .socratic-banner {
    background: linear-gradient(135deg, rgba(123,31,162,0.3), rgba(74,20,140,0.3));
    border: 1px solid rgba(206,147,216,0.4);
    color: #CE93D8;
}

body.light-mode .socratic-banner {
    background: linear-gradient(135deg, rgba(156,39,176,0.1), rgba(106,27,154,0.1));
    border: 1px solid rgba(156,39,176,0.3);
    color: #6A1B9A;
}

.socratic-exit-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0 2px;
}

body.dark-mode .socratic-exit-btn { color: #CE93D8; }
body.light-mode .socratic-exit-btn { color: #6A1B9A; }
.socratic-exit-btn:hover { opacity: 1; }

/* Note Toolbar */
.note-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.note-tool-btn {
    border: 1.5px solid;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: 'Lexend', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .note-tool-btn { border-color: rgba(72,197,181,0.35); color: #80CBC4; }
body.light-mode .note-tool-btn { border-color: rgba(102,187,106,0.45); color: #388E3C; }

body.dark-mode .note-tool-btn:hover { background: rgba(72,197,181,0.12); border-color: #48C5B5; color: #E0F2F1; }
body.light-mode .note-tool-btn:hover { background: rgba(102,187,106,0.18); border-color: #66BB6A; color: #1B5E20; }

.note-tool-btn.danger { border-color: rgba(239,83,80,0.4); }
body.dark-mode .note-tool-btn.danger { color: #EF9A9A; }
body.light-mode .note-tool-btn.danger { color: #C62828; }
.note-tool-btn.danger:hover { background: rgba(239,83,80,0.12) !important; border-color: #EF5350 !important; }

/* Rename inline input */
.note-rename-input {
    font-family: 'Lexend', sans-serif;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    border: 2px solid;
    padding: 6px 10px;
    flex: 1;
    background: transparent;
    transition: all 0.2s ease;
}

body.dark-mode .note-rename-input { border-color: #26A69A; color: #E0F2F1; }
body.light-mode .note-rename-input { border-color: #66BB6A; color: #1B5E20; }
.note-rename-input:focus { outline: none; }