:root {
    --primary: #2A5C82;
    --secondary: #4A90E2;
    --accent: #FF6B6B;
    --light: #F5F7FA;
    --dark: #1E2A38;
    --success: #4CAF50;
    --warning: #FFC107;
    --sidebar-width: 240px;
    --right-sidebar-width: 200px;
    --header-height: 140px;
    --paper: #fffef0;
    --paper-line: rgba(0, 0, 0, 0.1);
    --main-height: 817.76px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f4f8;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.chapter-header {
    background: linear-gradient(135deg, var(--primary), #1a3a5f);
    color: white;
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.login-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.back-home {
    font-size: large;
    font-weight: 200;
    color: var(--light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-home:hover {
    transform: translateX(-5px);
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-title {
    font-size: 1.8rem;
    font-weight: 600;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-controls {
    display: flex;
    gap: 15px;
}

.app-container {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    align-items: stretch;
}

.left-sidebar,
.right-sidebar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: var(--main-height);
}

.right-sidebar {
    width: var(--right-sidebar-width);
    flex-shrink: 0;
    height: auto;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: var(--main-height);
}

.sidebar-title {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.sidebar-title i {
    margin-right: 10px;
    font-size: 1rem;
}

.sidebar-section {
    margin-bottom: 25px;
}

.exam-selector,
.subject-selector,
.class-selector {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--dark);
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.exam-selector:focus,
.subject-selector:focus,
.class-selector:focus {
    border-color: var(--secondary);
}

.chapter-list {
    list-style: none;
    height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.chapter-list::-webkit-scrollbar {
    width: 6px;
}

.chapter-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chapter-item {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.chapter-item:hover {
    background: #f0f7ff;
    color: var(--primary);
}

.chapter-item.active {
    background: #e6f0ff;
    color: var(--primary);
    font-weight: 600;
}

.tools-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    flex-wrap: wrap;
    gap: 10px;
}

.content-mode {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.mode-btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background: #f0f4f8;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.mode-btn i {
    margin-right: 8px;
}

.mode-btn:hover {
    background: #e6ecf2;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 8px rgba(42, 92, 130, 0.2);
}

.content-tabs {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-tab {
    display: none;
    height: 100%;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.content-tab.active {
    display: block;
}

.notes-content {
    line-height: 1.8;
}

.notes-content h2 {
    color: var(--primary);
    margin: 20px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f4f8;
}

.notes-content p {
    margin-bottom: 15px;
}

.notes-content ul {
    margin: 15px 0;
    padding-left: 30px;
}

.notes-content li {
    margin-bottom: 10px;
}

.bookmarked {
    color: var(--accent);
}

.question-container {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.question-text {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--dark);
    line-height: 1.6;
}

.answer-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.answer-input:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: #1a3a5f;
    transform: translateY(-2px);
}

.tools-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #eee;
}

.tools-card h4 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.tools-card h4 i {
    margin-right: 10px;
    font-size: 0.9rem;
}

.tool-btn {
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    border: none;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.tool-btn i {
    margin-right: 10px;
    color: var(--primary);
    width: 20px;
}

.tool-btn:hover {
    background: #f0f7ff;
    transform: translateX(5px);
}

/* Unit Converter Styles */
.unit-converter {
    max-width: 100%;
}

.converter-controls {
    margin-bottom: 20px;
}

.category-selector {
    margin-bottom: 15px;
}

.category-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.conversion-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    gap: 10px;
}

.input-group input,
.input-group select {
    flex: 1;
}

.swap-button {
    flex-shrink: 0;
}

.conversion-result {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.formula-display {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary);
}

.common-conversions {
    margin-top: 20px;
}

.common-conversions h4 {
    margin-bottom: 10px;
    color: var(--primary);
}

.common-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.common-item {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #eee;
    font-size: 0.9rem;
}

/* Highlighter Styles */
#highlighter-tooltip {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
}

.highlighter-colors {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.color-btn {
    width: 25px;
    height: 25px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-btn.active {
    border-color: var(--dark);
    transform: scale(1.1);
}

.color-btn:hover {
    transform: scale(1.1);
}

.highlight-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.highlight-btn:hover {
    background: #1a3a5f;
}

.user-highlight {
    background-color: #FFEB3B;
    padding: 2px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-highlight:hover {
    opacity: 0.8;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .conversion-row {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group {
        min-width: 100%;
    }

    .swap-button {
        align-self: center;
    }

    #highlighter-tooltip {
        min-width: 120px;
        transform: scale(0.9);
    }
}

.floating-tools {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: orangered;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(42, 92, 130, 0.3);
    transition: all 0.3s;
    font-size: 1.2rem;
}

.float-btn:hover {
    background: var(--success);
    transform: translateY(-5px) scale(1.1);
}

.mobile-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    z-index: 100;
}

.footer-buttons {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.footer-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    flex: 1;
    max-width: 25%;
}

.footer-btn i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.footer-btn:hover {
    color: var(--primary);
}

.footer-btn.active {
    color: var(--primary);
    background: #f0f7ff;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: var(--primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* Notebook pages with consistent dimensions */
.notebook-container {
    background: var(--paper);
    padding: 20px;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    height: 100%;
}

.notebook-paper {
    background: var(--paper);
    background-image: linear-gradient(var(--paper-line) 1px, transparent 1px);
    background-size: 100% 2.2rem;
    padding: 2rem 3rem;
    width: 100%;
    max-width: 900px;
    min-height: 500px;
    height: 100%;
    margin: 0 auto 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-left: 1px solid #e0d6b9;
    position: relative;
    overflow: hidden;
}

.notebook-paper::before {
    content: "";
    position: absolute;
    left: 40px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e0d6b9;
}

.notebook-content {
    line-height: 2.2rem;
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
    padding-right: 15px;
}

.notebook-content h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.notebook-content h2 {
    font-size: 1.8rem;
    margin-top: 2.2rem;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid var(--secondary);
}

.notebook-content h3 {
    font-size: 1.4rem;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
}

.notebook-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.notebook-content ul,
.notebook-content ol {
    margin: 1.5rem 0;
    padding-left: 2.5rem;
}

.notebook-content li {
    margin-bottom: 0.8rem;
    position: relative;
}

.notebook-content li::before {
    content: "•";
    position: absolute;
    left: -1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

.formula-box {
    background: white;
    border: 2px solid var(--secondary);
    border-radius: 8px;
    padding: 15px;
    margin: 1.5rem 0;
    font-family: 'Roboto Slab', serif;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.1);
}

.highlight {
    background: linear-gradient(120deg, rgba(255, 247, 133, 0.3), rgba(255, 247, 133, 0.3));
    padding: 0 4px;
    border-radius: 3px;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(42, 92, 130, 0.2);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 0 20px;
    gap: 10px;
    background: #f8fafc;
    border-top: 1px solid #eee;
    padding: 15px 20px;
}

.page-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    max-width: 120px;
    font-weight: 500;
}

.page-btn:hover {
    background: #1a3a5f;
    transform: translateY(-2px);
}

.page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#pageIndicator {
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.fullscreen-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 50%;
}

.fullscreen-btn:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

.nav-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 120px;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.nav-btn i {
    margin: 0 5px;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

.calc-display {
    grid-column: span 4;
    padding: 15px;
    text-align: right;
    font-size: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8fafc;
    min-height: 60px;
    word-wrap: break-word;
    overflow: hidden;
}

.calc-btn {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}

.calc-btn:hover {
    background: #f0f7ff;
}

.calc-btn.func {
    background: #e6f0ff;
    font-size: 0.95rem;
}

.calc-btn.operator {
    background: #d1e7ff;
}

.calc-btn.equals {
    background: var(--primary);
    color: white;
}

.dictionary-search {
    display: flex;
    margin-bottom: 20px;
}

.dict-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
}

.dict-search-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}

.definition-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
}

/* Dictionary Suggestions Styles */
.suggestions-container {
    position: relative;
    width: 100%;
}

.suggestions-box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestions-title {
    padding: 8px 12px;
    margin: 0;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
    font-size: 14px;
}

.suggestion-item:hover {
    background-color: #f0f7ff;
    color: #1976d2;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-btn {
    background: #e3f2fd;
    border: 1px solid #1976d2;
    border-radius: 16px;
    padding: 6px 12px;
    color: #1976d2;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: #1976d2;
    color: white;
}

.suggestion-text {
    color: #666;
    margin-bottom: 8px;
}

/* Improved Definition Cards */
.definition-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.word-title {
    font-size: 28px;
    font-weight: bold;
    color: #1976d2;
    margin-bottom: 8px;
}

.phonetic {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.meaning-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.meaning-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.part-of-speech {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 8px;
}

.meaning {
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 8px;
}

.example {
    font-size: 14px;
    color: #666;
    font-style: italic;
    padding-left: 10px;
    border-left: 3px solid #1976d2;
    margin-top: 8px;
}

.translation-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.lang-selector {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
}

.translated-text {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border-left: 4px solid #1976d2;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #d32f2f;
}

.loader {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1976d2;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.word-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.phonetic {
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.meaning {
    margin-bottom: 5px;
}

.example {
    padding: 10px;
    background: white;
    border-left: 3px solid var(--secondary);
    margin-top: 10px;
    font-style: italic;
}

.topic-importance {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
    font-weight: 600;
}

.vimp {
    background-color: #ffebee;
    color: #c62828;
}

.imp {
    background-color: #fff8e1;
    color: #f57f17;
}

.average {
    background-color: #e3f2fd;
    color: #1565c0;
}

.topic-title {
    display: flex;
    align-items: center;
    margin: 20px 0 10px;
}

.translation-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.lang-selector {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.translation-result {
    background: white;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #eee;
    margin-top: 10px;
}

/* AI Assistant Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: #e3f2fd;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    text-align: right;
}

.ai-message {
    background: white;
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 1rem;
    outline: none;
}

.chat-input:focus {
    border-color: var(--secondary);
}

.send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: #1a3a5f;
    transform: scale(1.05);
}

.ai-tools-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ai-tool-btn {
    padding: 10px;
    border-radius: 8px;
    background: #f0f7ff;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
}

.ai-tool-btn:hover {
    background: #e1ecf7;
    border-color: var(--secondary);
}

.ai-tool-btn i {
    margin-right: 8px;
    color: var(--primary);
}

.topic-intro.vimp {
    background-color: #ffebee;
    border-left: 4px solid #c62828;
    padding: 10px 15px;
    margin: 15px 0;
}

.topic-intro.imp {
    background-color: #fff8e1;
    border-left: 4px solid #f57f17;
    padding: 10px 15px;
    margin: 15px 0;
}

.topic-intro.average {
    background-color: #e3f2fd;
    border-left: 4px solid #1565c0;
    padding: 10px 15px;
    margin: 15px 0;
}

.vimp-content {
    border: 1px solid #ffcdd2;
    background: #fff5f6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.imp-content {
    border: 1px solid #ffe0b2;
    background: #fffcf4;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.average-content {
    border: 1px solid #bbdefb;
    background: #f5fbff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.topic-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f4f8;
}

.topic-importance {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.topic-importance.vimp {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #c62828;
}

.topic-importance.imp {
    background-color: #fff8e1;
    color: #f57f17;
    border: 1px solid #f57f17;
}

.topic-importance.average {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #1565c0;
}

.example {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 3px solid #4A90E2;
}

.solution {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

.derivation {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px dashed #2A5C82;
}

.math-equation {
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    padding: 10px;
    text-align: center;
}

.diagram-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.content-diagram {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
}

.diagram-caption {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    font-size: 0.9rem;
}

.exam-context {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 4px solid #2A5C82;
}

/* Study Tools */
.bookmarks-container {
    margin-top: 20px;
}

.bookmark-item {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s;
}

.bookmark-item:hover {
    background: #e6f0ff;
    transform: translateX(3px);
}

.bookmark-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookmark-meta {
    font-size: 0.85rem;
    color: #666;
}

.note-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
}

.note-text {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
}

.note-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    background: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.note-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s;
}

.note-btn:hover {
    color: var(--primary);
    background: #f0f7ff;
}

.logbook-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.logbook-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    height: 150px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.logbook-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-modal-content {
    text-align: center;
    padding: 30px;
}

.login-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.login-btn-modal {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 20px;
    transition: all 0.3s;
    width: 100%;
}

.login-btn-modal:hover {
    background: #1a3a5f;
    transform: translateY(-3px);
}

.error-message {
    text-align: center;
    padding: 30px;
}

.error-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.error-text {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.user-notes-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px dashed #e0d6b9;
}

.user-notes-section h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.user-notes-section h3 i {
    font-size: 1.2rem;
    color: var(--primary);
    width: 24px;
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #ccc;
}

.add-note-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    resize: vertical;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.save-btn {
    background: var(--primary);
    color: white;
    border: none;
}

.save-btn:hover {
    background: #1a3a5f;
}

.cancel-btn {
    background: #f0f4f8;
    color: var(--dark);
    border: 1px solid #ddd;
}

.cancel-btn:hover {
    background: #e6ecf2;
}

/* Content-specific styles */
.content-container {
    line-height: 1.8;
}

.content-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.formula {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
}

.diagram {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.diagram-caption {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.important {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

/* Auth Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-weight: 500;
    color: var(--dark);
}

.form-input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--secondary);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.form-link {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.form-link:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #666;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    padding: 0 15px;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.google-btn:hover {
    background: #f8fafc;
    border-color: #ccc;
}

/* Book Collections */
.book-collection {
    margin-bottom: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.book-header {
    background: #f8fafc;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.book-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.book-content {
    padding: 15px;
    background: white;
}

.add-book-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.book-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Logbook Images */
.logbook-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.logbook-modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Translation Styles */
.translated-text {
    background: #f0f7ff;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border-left: 3px solid var(--secondary);
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 5% 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-about {
    grid-column: span 2;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-icon {
    color: var(--SU);
    font-size: 2rem;
}

.footer-about p {
    color: #ccc;
    margin-bottom: 20px;
}

.footer-links h3,
.footer-contact h3,
.footer-exams h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3:after,
.footer-contact h3:after,
.footer-exams h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--success);
}

.footer-links ul,
.footer-exams ul {
    list-style: none;
}

.footer-links li,
.footer-exams li {
    margin-bottom: 10px;
}

.footer-links a,
.footer-exams a {
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover,
.footer-exams a:hover {
    color: var(--success);
    padding-left: 5px;
}

.footer-contact p {
    color: #ccc;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: var(--success);
    transform: translateY(-5px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 0.9rem;
}

/* StudyVision AI Chatbot - Perfect Mobile & Desktop Styles */
:root {
    --chat-primary: #2A5C82;
    --chat-secondary: #4A90E2;
    --chat-accent: #FF6B6B;
    --chat-light: #F5F7FA;
    --chat-dark: #1E2A38;
    --chat-success: #4CAF50;
    --chat-warning: #FFC107;
    --chat-user-msg: #2A5C82;
    --chat-ai-msg: #FFFFFF;
    --chat-border: #E1E5E9;
    --chat-shadow: rgba(0, 0, 0, 0.1);
    --input-height: 56px;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--chat-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--chat-shadow);
    position: relative;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* Message Styles */
.message {
    max-width: 85%;
    animation: messageSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--chat-primary), #1a3a5f);
    color: white;
    border-radius: 18px 18px 6px 18px;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(42, 92, 130, 0.3);
    margin-left: 15%;
}

.ai-message {
    align-self: flex-start;
    background: var(--chat-ai-msg);
    border: 1px solid var(--chat-border);
    border-radius: 18px 18px 18px 6px;
    padding: 20px;
    box-shadow: 0 2px 12px var(--chat-shadow);
    margin-right: 15%;
}

.message.loading {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    box-shadow: none;
}

.message-content {
    line-height: 1.6;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 8px;
    text-align: right;
}

.ai-message .message-time {
    text-align: left;
    color: #6c757d;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-primary);
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

.typing-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced AI Response Formatting */
.ai-heading {
    color: var(--chat-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.ai-subheading {
    color: var(--chat-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 16px 0 8px 0;
}

.ai-mini-heading {
    color: var(--chat-dark);
    font-size: 1rem;
    font-weight: 500;
    margin: 12px 0 6px 0;
}

.ai-list {
    margin: 12px 0;
    padding-left: 24px;
}

.ai-list li {
    margin-bottom: 8px;
    color: var(--chat-dark);
    line-height: 1.5;
    padding-left: 8px;
}

.ai-list li.numbered {
    list-style-type: decimal;
}

.ai-quote {
    border-left: 4px solid var(--chat-secondary);
    padding: 12px 16px;
    margin: 16px 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #6c757d;
}

.code-block {
    background: #1e2a38;
    color: #e9ecef;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.inline-code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.ai-hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--chat-border), transparent);
    margin: 20px 0;
}

/* ===== PERFECT CHAT INPUT CONTAINER ===== */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chat-border);
    position: relative;
    min-height: var(--input-height);
}

/* Main Input Wrapper - Wider Area */
.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border: 2px solid var(--chat-border);
    border-radius: 25px;
    padding: 8px 8px 8px 16px;
    transition: all 0.3s ease;
    position: relative;
    min-height: var(--input-height);
}

.chat-input-wrapper:focus-within {
    border-color: var(--chat-secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Action Buttons Container - Inside Input */
.chat-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chat-action-btn {
    padding: 8px 12px;
    border: 1px solid var(--chat-border);
    background: white;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: auto;
    flex-shrink: 0;
}

.chat-action-btn:hover {
    background: #f8f9fa;
    border-color: var(--chat-secondary);
    transform: translateY(-1px);
}

.chat-action-btn.active {
    background: var(--chat-primary);
    color: white;
    border-color: var(--chat-primary);
    box-shadow: 0 2px 8px rgba(42, 92, 130, 0.3);
}

/* Thinking Mode Specific Styles */
.think-mode-auto {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #64b5f6;
}

.think-mode-reasoning {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-color: #4caf50;
}

.think-mode-creative {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    border-color: #ec407a;
}

/* Text Input - Takes Most Space */
.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    min-height: 24px;
    max-height: 80px;
    padding: 4px 0;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #6c757d;
}

/* Send Button */
.send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(42, 92, 130, 0.3);
}

.send-btn:hover:not(:disabled) {
    background: #1a3a5f;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(42, 92, 130, 0.4);
}

.send-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile Toolbar (Like ChatGPT) */
.mobile-toolbar {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

.mobile-toolbar-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.mobile-toolbar-toggle.active {
    transform: rotate(45deg);
    background: var(--chat-secondary);
}

.mobile-toolbar-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    border: 1px solid var(--chat-border);
}

.mobile-toolbar-menu.active {
    display: flex;
    animation: toolbarSlideUp 0.3s ease;
}

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

.mobile-toolbar-btn {
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: left;
}

.mobile-toolbar-btn:hover {
    background: #f8f9fa;
}

.mobile-toolbar-btn.active {
    background: var(--chat-primary);
    color: white;
}

/* Notifications */
.chat-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--chat-border);
}

.chat-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--chat-dark);
}

.notification-content i {
    color: var(--chat-secondary);
}

/* MathJax Styles */
.MathJax {
    font-size: 1.1em !important;
}

.mjx-chtml {
    outline: none;
}

/* Formula styling */
.formula-container {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--chat-secondary);
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .chat-container {
        border-radius: 0;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        background: white;
    }
    
    .chat-messages {
        padding: 16px 12px;
        max-height: calc(100vh - 140px);
        padding-bottom: 80px;
        gap: 16px;
    }
    
    .message {
        max-width: 90%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .user-message {
        max-width: 85%;
        border-radius: 18px 18px 6px 18px;
        padding: 14px 16px;
    }
    
    .ai-message {
        max-width: 90%;
        border-radius: 18px 18px 18px 6px;
        padding: 16px;
    }
    
    /* Mobile Input Container */
    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: white;
        border-top: 1px solid var(--chat-border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        gap: 8px;
        min-height: 80px;
    }
    
    .chat-input-wrapper {
        padding: 6px 6px 6px 12px;
        min-height: 52px;
    }
    
    /* Hide action buttons in input on mobile (moved to toolbar) */
    .chat-actions {
        display: none;
    }
    
    .chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 8px 0;
    }
    
    .send-btn {
        width: 44px;
        height: 44px;
    }
    
    /* Show Mobile Toolbar */
    .mobile-toolbar {
        display: block;
    }
    
    /* Mobile specific message styles */
    .message-content {
        font-size: 0.95rem;
    }
    
    .ai-heading {
        font-size: 1.1rem;
    }
    
    .ai-subheading {
        font-size: 1rem;
    }
    
    /* MathJax mobile adjustments */
    .MathJax {
        font-size: 1em !important;
    }
}

@media (max-width: 480px) {
    .chat-messages {
        padding: 12px 8px;
    }
    
    .chat-input-container {
        padding: 10px 12px;
    }
    
    .chat-input-wrapper {
        padding: 4px 4px 4px 10px;
        min-height: 48px;
    }
    
    .chat-input {
        padding: 6px 0;
        font-size: 0.95rem;
    }
    
    .send-btn {
        width: 40px;
        height: 40px;
    }
    
    .mobile-toolbar {
        bottom: 70px;
        right: 16px;
    }
    
    .mobile-toolbar-toggle {
        width: 52px;
        height: 52px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Error Message Styles */
.message.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Loading States */
.message.loading .message-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6c757d;
}

/* Print Styles */
@media print {
    .chat-input-container,
    .chat-actions,
    .send-btn,
    .mobile-toolbar {
        display: none !important;
    }
    
    .chat-container {
        height: auto;
        overflow: visible;
    }
    
    .chat-messages {
        overflow: visible;
        max-height: none;
    }
}

/* Smooth transitions for all interactive elements */
.chat-action-btn,
.send-btn,
.chat-input,
.message,
.mobile-toolbar-toggle {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.chat-action-btn:focus,
.send-btn:focus,
.chat-input:focus {
    outline: 2px solid var(--chat-secondary);
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .chat-container {
        border: 2px solid var(--chat-dark);
    }
    
    .message {
        border: 1px solid var(--chat-dark);
    }
}