/**
 * IHK Lernapp Pro - Notes Styling
 * OneNote-aehnliches Interface mit Dark Theme
 */

/* ═══════════════════════════════════════════════════════════════
   HEADER & NAV - Gleich wie in base.css
   ═══════════════════════════════════════════════════════════════ */

.header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
    padding: 1rem 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1800px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: white;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f1f5f9;
    display: block;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

.gamification-stats {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #334155;
}

.stat-badge svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.stat-badge.xp svg { color: #fbbf24; }
.stat-badge.level svg { color: #3b82f6; }
.stat-badge.streak svg { color: #f97316; }

.stat-value {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
}

.stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    border: 1px solid #334155;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.nav-bar {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0 1.5rem;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1800px;
    margin: 0 auto;
}

.nav-tabs {
    display: flex;
    gap: 0.25rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.nav-tab svg {
    width: 18px;
    height: 18px;
}

.notes-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.search-box svg {
    color: #64748b;
}

.search-box input {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 0.875rem;
    outline: none;
    width: 200px;
}

.search-box input::placeholder {
    color: #64748b;
}

/* ═══════════════════════════════════════════════════════════════
   NOTES CONTAINER - 3-Panel Layout
   ═══════════════════════════════════════════════════════════════ */

.notes-container {
    display: grid;
    grid-template-columns: 220px 280px 1fr;
    height: calc(100vh - 130px);
    background: #0f172a;
}

/* Sidebar - Notebooks */
.notes-sidebar {
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #334155;
}

.sidebar-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-icon {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.notebooks-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.notebook-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.notebook-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.notebook-item.active {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
}

.notebook-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.notebook-name {
    font-size: 0.875rem;
    color: #f1f5f9;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notebook-count {
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* Sections Panel */
.sections-panel {
    background: #1a2332;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #334155;
}

.sections-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sections-list {
    padding: 0.5rem;
    border-bottom: 1px solid #334155;
}

.section-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.125rem;
}

.section-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.section-item.active {
    background: rgba(34, 197, 94, 0.15);
    border-left: 2px solid #22c55e;
}

.section-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.section-name {
    font-size: 0.8125rem;
    color: #e2e8f0;
    flex: 1;
}

.section-count {
    font-size: 0.7rem;
    color: #64748b;
}

.pages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.pages-header h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
}

.pages-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.page-item {
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
    border-left: 2px solid transparent;
}

.page-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.page-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.page-item.pinned {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: #fbbf24;
}

.page-title {
    font-size: 0.8125rem;
    color: #f1f5f9;
    font-weight: 500;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-preview {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    color: #475569;
}

/* Editor Panel */
.editor-panel {
    display: flex;
    flex-direction: column;
    background: #0f172a;
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    background: #1e293b;
}

.page-title-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 1.5rem;
    font-weight: 600;
    outline: none;
}

.page-title-input::placeholder {
    color: #475569;
}

.page-title-input:disabled {
    cursor: default;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-save-status {
    font-size: 0.75rem;
    color: #64748b;
    margin-right: 0.5rem;
}

.auto-save-status.saving {
    color: #fbbf24;
}

.auto-save-status.saved {
    color: #22c55e;
}

.editor-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
}

.tag-input {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 0.75rem;
    outline: none;
    flex: 1;
    min-width: 120px;
}

.tag-input::placeholder {
    color: #475569;
}

/* Quill Editor Container */
#editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
}

.editor-placeholder p {
    margin-top: 1rem;
    font-size: 0.9rem;
}

#quill-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Quill Theme Override */
.ql-toolbar.ql-snow {
    background: #1e293b;
    border: none;
    border-bottom: 1px solid #334155;
    padding: 0.75rem 1.5rem;
}

.ql-toolbar.ql-snow .ql-stroke {
    stroke: #94a3b8;
}

.ql-toolbar.ql-snow .ql-fill {
    fill: #94a3b8;
}

.ql-toolbar.ql-snow .ql-picker {
    color: #94a3b8;
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke {
    stroke: #3b82f6;
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill {
    fill: #3b82f6;
}

.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: #3b82f6;
}

.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: #3b82f6;
}

.ql-container.ql-snow {
    background: #0f172a;
    border: none;
    flex: 1;
    font-family: inherit;
    font-size: 1rem;
}

.ql-editor {
    color: #e2e8f0;
    padding: 1.5rem;
    line-height: 1.8;
}

.ql-editor::before {
    color: #475569;
    font-style: normal;
}

.ql-editor h1, .ql-editor h2, .ql-editor h3 {
    color: #f1f5f9;
}

.ql-editor a {
    color: #60a5fa;
}

.ql-editor code {
    background: rgba(255, 255, 255, 0.1);
    color: #a5f3fc;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.ql-editor blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    color: #94a3b8;
}

.ql-snow .ql-picker.ql-expanded .ql-picker-options {
    background: #1e293b;
    border: 1px solid #334155;
}

.ql-snow .ql-picker-options .ql-picker-item {
    color: #94a3b8;
}

.ql-snow .ql-picker-options .ql-picker-item:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1.5rem;
    background: #1e293b;
    border-top: 1px solid #334155;
    font-size: 0.75rem;
    color: #64748b;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    font-size: 1.125rem;
    color: #f1f5f9;
    margin-bottom: 1.25rem;
}

.modal-content input[type="text"] {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #f1f5f9;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.color-picker span {
    color: #94a3b8;
    font-size: 0.875rem;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.loading-spinner {
    text-align: center;
    color: #64748b;
    padding: 2rem;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: #475569;
    padding: 2rem 1rem;
    font-size: 0.875rem;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .notes-container {
        grid-template-columns: 200px 240px 1fr;
    }
}

@media (max-width: 992px) {
    .notes-container {
        grid-template-columns: 180px 1fr;
    }

    .sections-panel {
        display: none;
    }

    .sections-panel.active {
        display: flex;
        position: fixed;
        left: 180px;
        top: 130px;
        bottom: 0;
        width: 260px;
        z-index: 100;
    }
}

@media (max-width: 768px) {
    .gamification-stats {
        display: none;
    }

    .notes-container {
        grid-template-columns: 1fr;
    }

    .notes-sidebar {
        display: none;
    }

    .notes-sidebar.active {
        display: flex;
        position: fixed;
        left: 0;
        top: 130px;
        bottom: 0;
        width: 280px;
        z-index: 100;
    }

    .nav-tabs {
        overflow-x: auto;
    }

    .search-box {
        display: none;
    }
}
