/* Project Organizer Styles */

.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr 240px;
    gap: 1rem;
    height: 100%;
    overflow: hidden;
}

.sidebar,
.main-content,
.toc {
    background-color: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar {
    min-height: 0;
}

.sidebar-header h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-weight: 600;
    flex-shrink: 0;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.filter-btn {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #e2e8f0;
}

.filter-btn.active {
    background-color: #3b82f6;
    color: white;
}

.search-input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.project-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    min-height: 0;
}

.project-item {
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.project-item:hover {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.project-item.selected {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.project-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.project-status {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-date {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.new-project-btn,
.export-btn {
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.new-project-btn {
    background-color: #10b981;
    color: white;
}

.new-project-btn:hover {
    background-color: #059669;
}

.export-btn {
    background-color: #64748b;
    color: white;
}

.export-btn:hover {
    background-color: #475569;
}

.main-content {
    min-height: 0;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
}

.project-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* Form Field Styles */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.editor-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
    align-items: start;
}

.editor-header .form-field:first-child {
    grid-column: 1;
}

.editor-header .form-field:nth-child(2) {
    grid-column: 2;
}

.action-buttons {
    grid-column: 3;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding-top: 1.5rem; /* Align with inputs after label */
}

.project-title-input {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
}

.status-select {
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 0.875rem;
    min-width: 150px;
}

.save-btn,
.delete-btn,
.pin-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.save-btn {
    background-color: #3b82f6;
    color: white;
}

.save-btn:hover:not(:disabled) {
    background-color: #2563eb;
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pin-btn {
    background-color: #f59e0b;
    color: white;
}

.pin-btn:hover {
    background-color: #d97706;
}

.delete-btn {
    background-color: #ef4444;
    color: white;
}

.delete-btn:hover {
    background-color: #dc2626;
}

/* Rich Text Editor Styles */
.rte-custom {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.rte-custom .e-rte-toolbar {
    border-bottom: 2px solid #e2e8f0;
    background-color: #f8fafc;
}

.rte-custom .e-rte-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.rte-custom .e-rte-content .e-content {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Markdown preview styling */
.rte-custom .e-md-preview {
    padding: 1rem;
}

.content-textarea {
    flex: 1;
    width: 100%;
    resize: none;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background-color: #fafafa;
    min-height: 0;
}

.content-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: white;
}

.timestamps {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #64748b;
    text-align: right;
    flex-shrink: 0;
}

.toc {
    min-height: 0;
}

.toc h4 {
    margin-top: 0;
    color: #374151;
    font-weight: 600;
    flex-shrink: 0;
}

.toc-empty {
    font-size: 0.875rem;
    color: #9ca3af;
    font-style: italic;
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.toc-list li {
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.toc-list li:hover {
    background-color: #f1f5f9;
}

.export-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 1000;
    width: 600px;
    max-width: 90vw;
}

.export-container h4 {
    margin-top: 0;
    color: #374151;
}

.export-textarea {
    width: 100%;
    height: 300px;
    margin: 1rem 0;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 1rem;
    background-color: #fafafa;
}

.export-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.export-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    background-color: #64748b;
    color: white;
    transition: background-color 0.2s ease;
}

.export-actions button:hover {
    background-color: #475569;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .app-layout {
        grid-template-columns: 240px 1fr 200px;
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 200px 1fr;
        grid-template-rows: auto 200px;
        grid-template-areas:
            "sidebar main"
            "toc main";
    }

    .sidebar {
        grid-area: sidebar;
    }

    .main-content {
        grid-area: main;
    }

    .toc {
        grid-area: toc;
        max-height: 200px;
    }
}

@media (max-width: 900px) {
    .editor-header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .editor-header .form-field:first-child,
    .editor-header .form-field:nth-child(2),
    .action-buttons {
        grid-column: 1;
    }
    
    .action-buttons {
        padding-top: 0;
    }
}

@media (max-width: 600px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }

    .sidebar,
    .toc {
        height: 200px;
    }
}



