/* Cornell Notes Generator - Public CSS
 * This file contains styles for the public-facing side of the plugin
 */

/* Main container */
.cornell-notes-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    color: #1e293b;
    padding: 1.5rem;
}

/* Page layout */
.cornell-notes-page {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Header */
.cornell-notes-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.cornell-notes-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.cornell-notes-header-content {
    max-width: 1000px;
    margin: 0 auto;
}

.cornell-notes-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.cornell-notes-header p {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Main content */
.cornell-notes-main {
    padding: 1.5rem;
    position: relative;
}

.cornell-notes-main-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    position: relative;
    align-items: flex-start;
}

/* Sidebar */
.cornell-notes-sidebar {
    width: 320px;
    min-width: 320px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.75rem;
    padding: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.cornell-notes-sidebar-collapsed {
    width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

.cornell-notes-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.cornell-notes-sidebar-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.cornell-notes-toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #64748b;
    transition: color 0.2s;
}

.cornell-notes-toggle-sidebar:hover {
    color: #1e293b;
}

.cornell-notes-refresh-list {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    transition: all 0.2s;
}

.cornell-notes-refresh-list:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.cornell-notes-saved-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cornell-notes-saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.cornell-notes-saved-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.cornell-notes-saved-item-content {
    flex: 1;
    min-width: 0;
}

.cornell-notes-saved-item-title {
    margin: 0 0 0.375rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.cornell-notes-saved-item-date {
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.cornell-notes-saved-item-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.cornell-notes-load-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #3b82f6;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.cornell-notes-load-btn:hover {
    color: #2563eb;
}

.cornell-notes-loading-text,
.cornell-notes-no-notes,
.cornell-notes-error-text {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #64748b;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cornell-notes-error-text {
    color: #dc2626;
    background-color: #fee2e2;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 0.5rem 0;
}

.cornell-notes-no-notes {
    font-style: italic;
}

@media (max-width: 1024px) {
    .cornell-notes-main-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cornell-notes-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 400px;
        order: 2;
    }
    
    .cornell-notes-content-wrapper {
        order: 1;
        width: 100%;
    }
    
    .cornell-notes-sidebar-collapsed {
        display: none;
    }
}

@media (max-width: 768px) {
    .cornell-notes-main {
        padding: 1rem;
    }
    
    .cornell-notes-sidebar {
        max-height: 300px;
        padding: 1rem;
    }
    
    .cornell-notes-form-container {
        margin-bottom: 1.5rem;
    }
}

/* Form Container - Takes remaining space */
.cornell-notes-form-container {
    margin-bottom: 2rem;
    flex: 1;
    min-width: 0;
}

.cornell-notes-content-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.cornell-notes-form-label {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.cornell-notes-form {
    display: flex;
    gap: 0.75rem;
}

.cornell-notes-input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.cornell-notes-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    background-color: #fafbfc;
}

.cornell-notes-button {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px -1px rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.cornell-notes-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.cornell-notes-button:active {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    transform: translateY(0) scale(0.98);
}

.cornell-notes-button:disabled {
    background-color: #93c5fd;
    cursor: not-allowed;
}

/* Error message */
.cornell-notes-error {
    margin-top: 0.75rem;
    padding: 0.75rem;
    color: #b91c1c;
    background-color: #fee2e2;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

/* Loading state */
.cornell-notes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.cornell-notes-hidden {
    display: none !important;
}

.cornell-notes-spinner {
    margin-top: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Notes display */
.cornell-notes-display {
    margin-top: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 0.75rem;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.cornell-notes-title {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.cornell-notes-title h2 {
    margin: 0;
    flex: 1;
    font-size: 1.625rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.cornell-notes-actions {
    display: flex;
    gap: 0.5rem;
}

.cornell-notes-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px -1px rgba(16, 185, 129, 0.3);
}

.cornell-notes-save-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.cornell-notes-save-btn:active {
    transform: translateY(0);
}

.cornell-notes-save-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.cornell-notes-success {
    color: #065f46;
    background-color: #d1fae5;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.cornell-notes-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    background-color: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@media (max-width: 768px) {
    .cornell-notes-grid {
        grid-template-columns: 1fr;
    }
}

.cornell-notes-column-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    color: #334155;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8125rem;
}

.cornell-notes-cue-column {
    border-right: 2px solid #e2e8f0;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.cornell-notes-notes-column {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.cornell-notes-cue-column .cornell-notes-item {
    font-weight: 500;
    color: #334155;
    background-color: transparent;
}

.cornell-notes-items {
    padding: 0.5rem 0;
}

.cornell-notes-item {
    position: relative;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    line-height: 1.7;
    font-size: 0.9375rem;
    color: #1e293b;
    min-height: 3rem;
    transition: background-color 0.2s ease;
}

.cornell-notes-item:hover {
    background-color: rgba(248, 250, 252, 0.5);
}

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

.cornell-notes-summary {
    padding: 1.5rem 1.75rem;
    padding-right: 5rem !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 2px solid #e2e8f0;
    position: relative;
    min-height: 4rem;
    box-shadow: 0 -2px 4px -1px rgba(0, 0, 0, 0.05);
}

.cornell-notes-summary h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.cornell-notes-summary > div {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #1e293b;
}

/* Code examples */
.cornell-notes-code-section {
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: white;
    width: 100%;
    max-width: 100%;
}

.cornell-notes-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.cornell-notes-code-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #334155;
}

.cornell-notes-code-example {
    margin: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.cornell-notes-code-example:last-child {
    margin-bottom: 1.5rem;
}

.cornell-notes-code-title {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.5;
}

.cornell-notes-code-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #0f172a;
    border-bottom: 1px solid #334155;
}

.cornell-notes-code-button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background-color: #475569;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cornell-notes-code-button svg {
    width: 1rem;
    height: 1rem;
}

.cornell-notes-code-button:hover {
    background-color: #64748b;
}

.cornell-notes-code-button:active {
    background-color: #334155;
    transform: scale(0.98);
}

.cornell-notes-remove-btn {
    background-color: #ef4444;
}

.cornell-notes-remove-btn:hover {
    background-color: #dc2626;
}

.cornell-notes-code-block {
    margin: 0;
    padding: 1.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9375rem;
    line-height: 1.7;
    overflow-x: auto;
    background-color: #1e293b;
    color: #f1f5f9;
    white-space: pre;
    word-wrap: break-word;
    max-width: 100%;
    display: block;
}

.cornell-notes-code-block::-webkit-scrollbar {
    height: 8px;
}

.cornell-notes-code-block::-webkit-scrollbar-track {
    background: #0f172a;
}

.cornell-notes-code-block::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.cornell-notes-code-block::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Code syntax highlighting */
.cornell-notes-code-block .keyword {
    color: #60a5fa;
    font-weight: 500;
}

.cornell-notes-code-block .string {
    color: #34d399;
}

.cornell-notes-code-block .comment {
    color: #94a3b8;
    font-style: italic;
    opacity: 0.9;
}

.cornell-notes-code-block .number {
    color: #f87171;
}

.cornell-notes-code-block .function {
    color: #a78bfa;
    font-weight: 500;
}

/* Code editor */
.cornell-notes-code-editor {
    width: 100%;
    min-height: 250px;
    padding: 1.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9375rem;
    line-height: 1.7;
    background-color: #1e293b;
    color: #f1f5f9;
    border: none;
    resize: vertical;
    box-sizing: border-box;
}

.cornell-notes-code-editor:focus {
    outline: none;
}

.cornell-notes-title-editor {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
}

.cornell-notes-title-editor:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Note editing */
.cornell-notes-item {
    position: relative;
    padding-right: 4rem !important;
}

.cornell-notes-edit-note-btn,
.cornell-notes-remove-note-btn {
    position: absolute;
    top: 0.5rem;
    background-color: #2563eb !important;
    border: 2px solid #1e40af !important;
    border-radius: 0.375rem;
    cursor: pointer !important;
    padding: 0.5rem !important;
    opacity: 1 !important;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4) !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    pointer-events: auto !important;
    min-width: 2.5rem !important;
    min-height: 2.5rem !important;
    width: 2.5rem !important;
    height: 2.5rem !important;
}

.cornell-notes-edit-note-btn {
    right: 0.5rem;
    background-color: #2563eb !important;
}

.cornell-notes-remove-note-btn {
    right: 3.5rem;
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4) !important;
}

.cornell-notes-edit-note-btn:hover,
.cornell-notes-remove-note-btn:hover {
    opacity: 1 !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

.cornell-notes-edit-note-btn:hover {
    background-color: #1d4ed8 !important;
    border-color: #1e3a8a !important;
}

.cornell-notes-remove-note-btn:hover {
    background-color: #b91c1c !important;
    border-color: #991b1b !important;
}

.cornell-notes-edit-note-btn:active,
.cornell-notes-remove-note-btn:active {
    transform: translateY(0) scale(0.98);
}

.cornell-notes-edit-note-btn svg,
.cornell-notes-remove-note-btn svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    fill: #ffffff !important;
    color: #ffffff !important;
}

.cornell-notes-save-note-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cornell-notes-save-note-btn:hover {
    background-color: #1d4ed8;
}

.cornell-notes-save-note-btn svg {
    width: 1rem;
    height: 1rem;
}

.cornell-notes-edit-input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
}

.cornell-notes-edit-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.cornell-notes-rich-editor {
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background-color: white;
    margin-bottom: 2rem;
}

.cornell-notes-rich-editor:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.cornell-notes-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

.cornell-notes-toolbar-separator {
    width: 1px;
    height: 1.5rem;
    background-color: #cbd5e1;
    margin: 0 0.25rem;
}

.cornell-notes-editor-toolbar button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.375rem;
}

.cornell-notes-editor-toolbar button:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.cornell-notes-editor-toolbar button.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.cornell-notes-editor-toolbar button.active svg {
    fill: white;
}

.cornell-notes-editor-toolbar button svg {
    width: 1rem;
    height: 1rem;
}

.cornell-notes-add-note-btn {
    display: block;
    margin: 1rem auto;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cornell-notes-add-note-btn:hover {
    background-color: #1d4ed8;
}

.cornell-notes-add-note-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.cornell-notes-add-code-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: white;
    background-color: #2563eb;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cornell-notes-add-code-btn:hover {
    background-color: #1d4ed8;
}

.cornell-notes-add-code-btn svg {
    width: 1rem;
    height: 1rem;
}

/* Disclaimer */
.cornell-notes-disclaimer {
    margin-top: 1.5rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

/* Footer */
.cornell-notes-footer {
    padding: 1.5rem;
    background-color: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cornell-notes-form {
        flex-direction: column;
    }
    
    .cornell-notes-grid {
        grid-template-columns: 1fr;
    }
    
    .cornell-notes-cue-column {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* List styling in notes */
.cornell-notes-item ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.cornell-notes-item li {
    margin-bottom: 0.25rem;
}

.cornell-notes-item p {
    margin: 0 0 0.5rem 0;
}

.cornell-notes-item p:last-child {
    margin-bottom: 0;
}

/* Rich text editor content styling */
.cornell-notes-rich-editor ul {
    list-style-type: disc;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.cornell-notes-rich-editor ol {
    list-style-type: decimal;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.cornell-notes-rich-editor li {
    margin-bottom: 0.25rem;
}

.cornell-notes-rich-editor p {
    margin: 0 0 0.5rem 0;
}

.cornell-notes-rich-editor p:last-child {
    margin-bottom: 0;
}

.cornell-notes-rich-editor b,
.cornell-notes-rich-editor strong {
    font-weight: bold;
}

.cornell-notes-rich-editor i,
.cornell-notes-rich-editor em {
    font-style: italic;
}

.cornell-notes-rich-editor u {
    text-decoration: underline;
}

.cornell-notes-rich-editor s,
.cornell-notes-rich-editor strike,
.cornell-notes-rich-editor del {
    text-decoration: line-through;
}

.cornell-notes-rich-editor h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
    color: #1e293b;
    line-height: 1.3;
}

.cornell-notes-rich-editor h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0 0.25rem 0;
    color: #334155;
    line-height: 1.4;
}

.cornell-notes-rich-editor a {
    color: #2563eb;
    text-decoration: underline;
}

.cornell-notes-rich-editor a:hover {
    color: #1e40af;
}

/* Markdown rendering styles */
.cornell-notes-h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem 0;
    color: #1e293b;
    line-height: 1.2;
}

.cornell-notes-h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.25rem 0 0.75rem 0;
    color: #1e293b;
    line-height: 1.3;
}

.cornell-notes-h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem 0;
    color: #334155;
    line-height: 1.4;
}

.cornell-notes-h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
    color: #475569;
    line-height: 1.4;
}

.cornell-notes-hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 1.5rem 0;
}

.cornell-notes-markdown-code {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.cornell-notes-markdown-code code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
    border: none;
}

.cornell-notes-inline-code {
    background-color: #f1f5f9;
    color: #dc2626;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    border: 1px solid #e2e8f0;
}

.cornell-notes-item strong,
.cornell-notes-summary strong {
    font-weight: 600;
    color: #1e293b;
    background-color: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.cornell-notes-item em,
.cornell-notes-summary em {
    font-style: italic;
    color: #475569;
}

.cornell-notes-item del,
.cornell-notes-summary del {
    text-decoration: line-through;
    color: #94a3b8;
    background-color: #f1f5f9;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.cornell-notes-item mark,
.cornell-notes-summary mark {
    background-color: #fef08a;
    color: #1e293b;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.cornell-notes-item a,
.cornell-notes-summary a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.cornell-notes-item a:hover,
.cornell-notes-summary a:hover {
    color: #1e40af;
    text-decoration: none;
}

/* Combined formatting */
.cornell-notes-item strong em,
.cornell-notes-summary strong em,
.cornell-notes-item em strong,
.cornell-notes-summary em strong {
    font-weight: 600;
    font-style: italic;
    background-color: #fef3c7;
    color: #1e293b;
}

/* List styling for markdown */
.cornell-notes-item .list-disc,
.cornell-notes-summary .list-disc {
    list-style-type: disc;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.cornell-notes-item .list-decimal,
.cornell-notes-summary .list-decimal {
    list-style-type: decimal;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* MathJax styling */
.arithmatex {
    line-height: 1.6;
}

/* Inline math equations */
.arithmatex .MathJax {
    display: inline !important;
    margin: 0 !important;
}

/* Display math equations (centered, on their own line) */
.arithmatex .MathJax[display="true"] {
    display: block !important;
    margin: 1rem 0 !important;
    text-align: center;
}

/* MathJax error messages */
.MathJax_Error {
    color: #dc2626;
    background-color: #fee2e2;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

/* Ensure MathJax doesn't break layout */
.arithmatex mjx-container {
    display: inline-block;
    margin: 0 0.2em;
    vertical-align: middle;
}

.arithmatex mjx-container[display="true"] {
    display: block;
    margin: 1em auto;
    text-align: center;
}

/* Math Examples Section Styling */
.cornell-notes-math-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.cornell-notes-math-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #2563eb;
}

.cornell-notes-math-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.cornell-notes-math-example {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    border-left: 4px solid #2563eb;
}

.cornell-notes-math-example:last-child {
    margin-bottom: 0;
}

.cornell-notes-math-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #cbd5e1;
    position: relative;
    padding-right: 2rem;
}

.cornell-notes-math-title .cornell-notes-edit-math-title-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cornell-notes-math-title:hover .cornell-notes-edit-math-title-btn {
    opacity: 1;
}

.cornell-notes-math-problem,
.cornell-notes-math-solution,
.cornell-notes-math-explanation {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.cornell-notes-math-problem:last-child,
.cornell-notes-math-solution:last-child,
.cornell-notes-math-explanation:last-child {
    margin-bottom: 0;
}

.cornell-notes-math-problem strong,
.cornell-notes-math-solution strong,
.cornell-notes-math-explanation strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.cornell-notes-math-problem-content,
.cornell-notes-math-solution-content,
.cornell-notes-math-explanation-content {
    padding: 0.75rem;
    background-color: #ffffff;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    position: relative;
    padding-right: 2.5rem;
}

.cornell-notes-math-problem-content .cornell-notes-edit-math-btn,
.cornell-notes-math-solution-content .cornell-notes-edit-math-btn,
.cornell-notes-math-explanation-content .cornell-notes-edit-math-btn {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cornell-notes-math-problem-content:hover .cornell-notes-edit-math-btn,
.cornell-notes-math-solution-content:hover .cornell-notes-edit-math-btn,
.cornell-notes-math-explanation-content:hover .cornell-notes-edit-math-btn {
    opacity: 1;
}

.cornell-notes-math-example {
    position: relative;
}

.cornell-notes-remove-math-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 10;
}

.cornell-notes-math-example:hover .cornell-notes-remove-math-btn {
    opacity: 1;
}

.cornell-notes-math-example .cornell-notes-rich-editor {
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    background-color: #ffffff;
}

.cornell-notes-math-example .cornell-notes-editor-toolbar {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f8fafc;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

.cornell-notes-math-example .cornell-notes-save-math-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.cornell-notes-math-example .cornell-notes-save-math-btn:hover {
    background-color: #1e40af;
}

.cornell-notes-math-solution-content {
    background-color: #f0f9ff;
    border-color: #bae6fd;
}

.cornell-notes-math-solution-content pre {
    background-color: #ffffff;
    padding: 0.5rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
}

.cornell-notes-math-problem-content .arithmatex,
.cornell-notes-math-solution-content .arithmatex,
.cornell-notes-math-explanation-content .arithmatex {
    font-size: 1rem;
}

/* Formatting in math examples */
.cornell-notes-math-problem-content strong,
.cornell-notes-math-solution-content strong,
.cornell-notes-math-explanation-content strong {
    font-weight: 600;
    color: #1e293b;
    background-color: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.cornell-notes-math-problem-content em,
.cornell-notes-math-solution-content em,
.cornell-notes-math-explanation-content em {
    font-style: italic;
    color: #475569;
}

.cornell-notes-math-problem-content mark,
.cornell-notes-math-solution-content mark,
.cornell-notes-math-explanation-content mark {
    background-color: #fef08a;
    color: #1e293b;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Improve readability of formatted text */
.cornell-notes-item p,
.cornell-notes-summary p {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.cornell-notes-item p:first-child,
.cornell-notes-summary p:first-child {
    margin-top: 0;
}

.cornell-notes-item p:last-child,
.cornell-notes-summary p:last-child {
    margin-bottom: 0;
}

/* Better spacing for formatted content */
.cornell-notes-item strong + em,
.cornell-notes-item em + strong,
.cornell-notes-summary strong + em,
.cornell-notes-summary em + strong {
    margin-left: 0.25rem;
}

/* Improve code block appearance */
.cornell-notes-item pre,
.cornell-notes-summary pre {
    background-color: #1e293b;
    color: #f1f5f9;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    border: 1px solid #334155;
}

.cornell-notes-item pre code,
.cornell-notes-summary pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}
