/* CSS Variables for Color Palette */
:root {
    --primary-dark: #03045E;
    --primary-medium: #023E8A;
    --primary-main: #0077B6;
    --primary-light: #0096C7;
    --primary-lightest: #90E0EF;
    --white: #FFFFFF;
    --light-gray: #F8F9FA;
    --medium-gray: #6C757D;
    --dark-gray: #343A40;
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --shadow: rgba(3, 4, 94, 0.1);
    --shadow-strong: rgba(3, 4, 94, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    color: var(--dark-gray);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    color: var(--white);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.app-logo {
    height: 40px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
    flex-shrink: 0;
}

.app-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    filter: brightness(1.2) contrast(1.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-main) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    color: var(--white);
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo-fallback:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.app-header h1 {
    font-size: 1.3rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    padding: 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Main Content */
.app-main {
    padding: 0.75rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

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

.content-section.hidden {
    display: none;
}

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

/* Search Section */
.search-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid var(--primary-lightest);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.search-box input:focus {
    border-color: var(--primary-main);
}

.btn-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 0.25rem;
    z-index: 10;
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
    width: 100%;
}

.search-result-item {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-main);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.search-result-item:hover {
    background: var(--primary-lightest);
    transform: translateX(5px);
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.search-result-content {
    color: var(--medium-gray);
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-highlight {
    background: var(--warning);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Notes Section */
.notes-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    min-height: 400px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    width: 100%;
}

.note-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--primary-main);
    position: relative;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-strong);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.note-title {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 1.1rem;
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
}

.note-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note-card:hover .note-actions {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.note-action-btn:hover {
    background: var(--primary-lightest);
    color: var(--primary-dark);
}

.note-content {
    color: var(--medium-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.note-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 20px;
    width: 100%;
    background: linear-gradient(transparent, var(--white));
}

.note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--medium-gray);
    margin-top: auto;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.note-tag {
    background: linear-gradient(135deg, var(--primary-lightest) 0%, #e3f2fd 100%);
    color: var(--primary-dark);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-lightest);
    box-shadow: 0 2px 4px rgba(0, 119, 182, 0.1);
    position: relative;
    overflow: hidden;
}

.note-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.note-tag:hover::before {
    left: 100%;
}

.note-tag:hover {
    background: linear-gradient(135deg, var(--primary-main) 0%, var(--primary-dark) 100%);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
    border-color: var(--primary-main);
}

.note-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.note-link {
    background: linear-gradient(135deg, var(--primary-main) 0%, #0077B6 100%);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid var(--primary-main);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.2);
    position: relative;
    overflow: hidden;
}

.note-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.note-link:hover::before {
    left: 100%;
}

.note-link:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #023e8a 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.4);
    border-color: var(--primary-dark);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--medium-gray);
}

.empty-logo {
    margin-bottom: 1.5rem;
}

.empty-state-logo {
    height: 90px;
    width: auto;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    transition: all 0.3s ease;
    filter: brightness(1.1) contrast(1.2);
    border: 3px solid rgba(0, 119, 182, 0.2);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.empty-state-logo:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    filter: brightness(1.2) contrast(1.3);
    border-color: rgba(0, 119, 182, 0.4);
}

.empty-logo .logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-main) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    color: var(--white);
    font-size: 2.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(0, 119, 182, 0.2);
    transition: all 0.3s ease;
}

.empty-logo .logo-fallback:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 119, 182, 0.4);
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.empty-state p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Graph Section */
.graph-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex-shrink: 0;
    width: 100%;
}

.graph-header h2 {
    color: var(--primary-dark);
    margin: 0;
    font-size: 1.25rem;
}

.graph-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    margin: 0.75rem 0;
    width: 100%;
    position: relative;
}

#knowledge-graph {
    width: 100%;
    height: 100%;
    min-height: 600px;
    max-height: calc(100vh - 300px);
    border: 2px solid var(--primary-lightest);
    border-radius: 8px;
    cursor: grab;
    display: block;
    background: var(--light-gray);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

#knowledge-graph:active {
    cursor: grabbing;
}

.graph-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* Export Section */
.export-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.export-container h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.25rem;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.export-card {
    background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.export-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-lightest);
    box-shadow: 0 8px 25px var(--shadow-strong);
}

.export-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.export-card h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.export-card p {
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.import-section {
    border-top: 2px solid var(--primary-lightest);
    padding-top: 1.5rem;
    text-align: center;
}

.import-section h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.import-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* FAQ Section */
.faq-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.faq-container h2 {
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 2px solid var(--primary-lightest);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-main);
}

.faq-question {
    width: 100%;
    background: var(--light-gray);
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: var(--primary-lightest);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-main);
    color: var(--white);
}

.faq-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 1rem 1.5rem;
    background: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    border-top: 1px solid var(--primary-lightest);
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow-strong);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px) scale(0.9); }
    to { transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--primary-lightest);
}

.modal-header h3 {
    color: var(--primary-dark);
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: var(--primary-lightest);
    color: var(--primary-dark);
}

.modal-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--primary-lightest);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-main);
}

.form-group textarea {
    min-height: 200px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-main) 0%, var(--primary-medium) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-strong);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--primary-dark);
    border: 2px solid var(--primary-lightest);
}

.btn-secondary:hover {
    background: var(--primary-lightest);
    border-color: var(--primary-main);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0.25rem;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 100;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.6rem 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 50px;
    max-width: 80px;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    flex: 1;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    transition: transform 0.3s ease;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: var(--white);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.nav-item:hover span {
    transform: scale(1.05);
}

.nav-item.active {
    color: var(--white);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    color: var(--medium-gray);
    font-size: 0.8rem;
    margin-top: 2rem;
    border-top: 1px solid var(--primary-lightest);
}

footer a {
    color: var(--primary-lightest);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-lightest);
    transition: width 0.3s ease;
}

footer a:hover::before {
    width: 100%;
}

footer a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        padding: 0.5rem 0.75rem;
    }
    
    .header-brand {
        gap: 0.5rem;
    }
    
    .app-logo {
        height: 35px;
    }
    
    .logo-fallback {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .app-header h1 {
        font-size: 1.1rem;
    }
    
    .app-main {
        padding: 0.5rem;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .export-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .graph-container {
        min-height: calc(100vh - 120px);
        padding: 0.75rem;
    }
    
    .canvas-wrapper {
        min-height: 350px;
        margin: 0.5rem 0;
    }
    
    #knowledge-graph {
        min-height: 400px;
        max-height: calc(100vh - 180px);
    }
    
    .graph-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.5rem;
    }
    
    .graph-controls {
        justify-content: center;
        gap: 0.25rem;
    }
    
    .graph-legend {
        gap: 0.75rem;
    }
    
    .import-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 85vh;
    }
    
    .modal {
        z-index: 9999;
        padding: 0.5rem;
    }
    
    .nav-item {
        padding: 0.5rem 0.2rem;
        min-width: 45px;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.4rem 0.5rem;
    }
    
    .app-main {
        padding: 0.4rem;
    }
    
    .note-card,
    .export-card,
    .search-container,
    .notes-container,
    .graph-container,
    .export-container,
    .faq-container {
        padding: 0.75rem;
    }
    
    .notes-grid {
        gap: 0.5rem;
    }
    
    .export-options {
        gap: 0.5rem;
    }
    
    .graph-container {
        min-height: calc(100vh - 100px);
        padding: 0.5rem;
    }
    
    .canvas-wrapper {
        min-height: 300px;
    }
    
    #knowledge-graph {
        min-height: 350px;
        max-height: calc(100vh - 160px);
    }
    
    .nav-item {
        padding: 0.4rem 0.15rem;
        min-width: 40px;
        max-width: 70px;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .empty-state-logo {
        height: 60px;
    }
    
    .empty-logo .logo-fallback {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .app-logo {
        height: 30px;
    }
    
    .logo-fallback {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .app-header {
        padding: 0.3rem 0.4rem;
    }
    
    .app-main {
        padding: 0.3rem;
    }
    
    .note-card,
    .export-card,
    .search-container,
    .notes-container,
    .graph-container,
    .export-container,
    .faq-container {
        padding: 0.5rem;
    }
    
    .app-header h1 {
        font-size: 0.9rem;
    }
    
    .app-logo {
        height: 25px;
    }
    
    .logo-fallback {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }
    
    .nav-item {
        padding: 0.3rem 0.1rem;
        min-width: 35px;
        max-width: 60px;
    }
    
    .nav-item i {
        font-size: 0.9rem;
    }
    
    .nav-item span {
        font-size: 0.55rem;
    }
    
    .graph-container {
        min-height: calc(100vh - 80px);
    }
    
    #knowledge-graph {
        min-height: 300px;
        max-height: calc(100vh - 140px);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-main);
}

.text-muted {
    color: var(--medium-gray);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid var(--primary-lightest);
    border-top: 2px solid var(--primary-main);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

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

::-webkit-scrollbar-track {
    background: var(--light-gray);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-lightest);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-main);
}

/* Prevent horizontal scroll */
* {
    max-width: 100%;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Ensure containers don't overflow */
.container, .content-section, .app-main {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}
