/* Progress Notebook CSS - Slide-in panel from right side */

/* Panel overlay and backdrop */
.progress-notebook-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.progress-notebook-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main panel container */
.progress-notebook-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1051;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.progress-notebook-panel.show {
    right: 0;
}

/* Panel header */
.progress-notebook-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    flex-shrink: 0;
}

.progress-notebook-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-notebook-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.progress-notebook-close:hover {
    color: var(--text-primary);
}

/* Profile selector */
.progress-notebook-profile {
    margin-bottom: 1rem;
}

.progress-notebook-profile label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: block;
}

.progress-notebook-profile select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 0.375rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.progress-notebook-profile select:focus {
    outline: none;
    border-color: var(--navbar-bg);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* New profile button */
.progress-notebook-new-profile {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--navbar-bg);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.progress-notebook-new-profile:hover {
    background-color: #0b5ed7;
}

/* Panel content */
.progress-notebook-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Milestone sections */
.progress-notebook-milestone {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.progress-notebook-milestone:last-child {
    margin-bottom: 0;
}

.progress-notebook-milestone[open] .progress-notebook-milestone-header {
    border-bottom-color: var(--border-color);
}

.progress-notebook-milestone > summary {
    list-style: none;
}

.progress-notebook-milestone > summary::-webkit-details-marker {
    display: none;
}

.progress-notebook-milestone-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: background-color 0.2s ease;
}

.progress-notebook-milestone-header:focus-visible {
    outline: 2px solid var(--navbar-bg);
    outline-offset: 2px;
}

.progress-notebook-milestone-header:hover {
    background-color: var(--bg-tertiary);
}

.progress-notebook-milestone-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-notebook-milestone-title::before {
    content: '';
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-left: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.progress-notebook-milestone[open] .progress-notebook-milestone-title::before {
    transform: rotate(45deg);
}

.progress-notebook-milestone-body {
    padding: 0.75rem 1rem 1rem;
    background-color: var(--card-bg);
}

.progress-notebook-milestone-progress {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Task items */
.progress-notebook-task {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.progress-notebook-milestone-body .progress-notebook-task:last-child {
    margin-bottom: 0;
}

.progress-notebook-task:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--navbar-bg);
}

.progress-notebook-task.completed {
    background-color: var(--alert-success-bg);
    border-color: var(--alert-success-text);
}

.progress-notebook-task-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.progress-notebook-task-checkbox {
    margin: 0;
    transform: scale(1.1);
    cursor: pointer;
}

.progress-notebook-task-checkbox:checked {
    accent-color: var(--navbar-bg);
}

.progress-notebook-task-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.progress-notebook-task.completed .progress-notebook-task-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.progress-notebook-task-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.progress-notebook-task-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--navbar-bg);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.progress-notebook-task-link:hover {
    background-color: var(--navbar-bg);
    color: white;
    text-decoration: none;
}

.progress-notebook-task-link i {
    font-size: 0.75rem;
}

/* Ctrl+click indicator */
.progress-notebook-ctrl-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

/* New Profile Modal */
.progress-notebook-modal .modal-content {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.progress-notebook-modal .modal-header {
    border-bottom-color: var(--border-color);
}

.progress-notebook-modal .modal-footer {
    border-top-color: var(--border-color);
}

.progress-notebook-modal .form-control {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

.progress-notebook-modal .form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--navbar-bg);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive design */
@media (max-width: 768px) {
    .progress-notebook-panel {
        width: 100%;
        right: -100%;
    }
    
    .progress-notebook-panel.show {
        right: 0;
    }
}

/* Dark mode specific adjustments */
[data-theme="dark"] .progress-notebook-panel {
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .progress-notebook-task.completed {
    background-color: var(--alert-success-bg);
    border-color: var(--alert-success-text);
}

/* Loading states */
.progress-notebook-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.progress-notebook-loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error states */
.progress-notebook-error {
    background-color: var(--alert-danger-bg);
    color: var(--alert-danger-text);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Success states */
.progress-notebook-success {
    background-color: var(--alert-success-bg);
    color: var(--alert-success-text);
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Notes Modal Styles */
.progress-notebook-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.progress-notebook-notes-btn {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-notebook-notes-btn:hover {
    background-color: var(--navbar-bg);
    color: white;
    border-color: var(--navbar-bg);
}

/* Notes Modal Content */
.progress-notebook-add-note {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
}

.progress-notebook-add-note h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-notebook-task-tags {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: var(--input-bg);
}

.progress-notebook-task-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.progress-notebook-task-tag:last-child {
    border-bottom: none;
}

.progress-notebook-task-tag input[type="checkbox"] {
    margin: 0;
    transform: scale(0.9);
}

.progress-notebook-task-tag label {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    cursor: pointer;
    flex: 1;
}

.progress-notebook-task-tag .milestone-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Notes List */
.progress-notebook-notes-list h6 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-notebook-note {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--card-bg);
    transition: all 0.2s ease;
}

.progress-notebook-note:hover {
    border-color: var(--navbar-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.progress-notebook-note-text {
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.progress-notebook-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.progress-notebook-note-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: var(--navbar-bg);
    color: white;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.progress-notebook-note-tag:hover {
    background-color: #0b5ed7;
    color: white;
    text-decoration: none;
}

.progress-notebook-note-archived {
    opacity: 0.95;
    border-left: 3px solid var(--text-secondary);
}

.progress-notebook-note-delete-permanent {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.progress-notebook-note-delete-permanent:hover {
    color: var(--alert-danger-text);
    background-color: var(--alert-danger-bg);
}

.progress-notebook-note-archive,
.progress-notebook-note-restore,
.progress-notebook-note-delete {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.progress-notebook-note-delete:hover {
    color: var(--alert-danger-text);
    background-color: var(--alert-danger-bg);
}

.progress-notebook-note-archive:hover {
    color: var(--navbar-bg);
    background-color: rgba(13, 110, 253, 0.12);
}

.progress-notebook-note-restore:hover {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.12);
}

/* Empty notes state */
.progress-notebook-empty-notes {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.progress-notebook-empty-notes i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Notes modal responsive */
@media (max-width: 768px) {
    .progress-notebook-actions {
        flex-direction: column;
    }
    
    .progress-notebook-task-tags {
        max-height: 150px;
    }
    
    .progress-notebook-note-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .progress-notebook-note-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
