/* ============================================
   Private Notes - Personal Annotations
   Only visible to the authenticated user
   ============================================ */

.private-notes-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* --- Header (collapsible toggle) --- */

.private-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.private-notes-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.private-notes-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.private-notes-lock {
    color: var(--color-primary, #8b7fff);
    flex-shrink: 0;
}

.private-notes-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary, #f8f9fa);
}

.private-notes-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.4rem;
    background: rgba(139, 127, 255, 0.15);
    color: var(--color-primary, #8b7fff);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.private-notes-badge {
    font-size: 0.7rem;
    color: var(--color-text-secondary, #adb5bd);
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.private-notes-toggle-icon {
    font-size: 0.7rem;
    color: var(--color-text-secondary, #adb5bd);
    transition: transform 0.2s;
}


/* --- Body (expanded content) --- */

.private-notes-body {
    margin-top: 0.75rem;
}

.private-notes-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.private-notes-select {
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--color-text-primary, #f8f9fa);
    font-size: 0.8rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.4rem center;
    padding-right: 1.5rem;
}

.private-notes-select option {
    background: #1a1f3a;
    color: #f8f9fa;
}

.private-notes-add-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(139, 127, 255, 0.15);
    border: 1px solid rgba(139, 127, 255, 0.3);
    border-radius: 6px;
    color: var(--color-primary, #8b7fff);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-left: auto;
}

.private-notes-add-btn:hover {
    background: rgba(139, 127, 255, 0.25);
}


/* --- Add/Edit Form --- */

.private-notes-form {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.private-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--color-text-primary, #f8f9fa);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.private-notes-textarea:focus {
    outline: none;
    border-color: var(--color-primary, #8b7fff);
}

.private-notes-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.private-notes-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.private-notes-form-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-secondary, #adb5bd);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Priority stars */
.private-notes-priority {
    display: flex;
    gap: 0.125rem;
}

.priority-star {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, transform 0.1s;
}

.priority-star.active {
    color: #ffd93d;
}

.priority-star:hover {
    transform: scale(1.2);
}

/* Color swatches */
.private-notes-colors {
    display: flex;
    gap: 0.25rem;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s, transform 0.1s;
}

.color-swatch.active {
    border-color: #fff;
    transform: scale(1.15);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.private-notes-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.private-notes-save-btn {
    padding: 0.4rem 1rem;
    background: var(--color-primary, #8b7fff);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.private-notes-save-btn:hover {
    background: #7a6eff;
}

.private-notes-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.private-notes-cancel-btn {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary, #adb5bd);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}


/* --- Note Cards --- */

.private-note-card {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--note-color, #8b7fff);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.private-note-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--note-color, #8b7fff);
}

.private-note-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.private-note-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.private-note-priority {
    font-size: 0.75rem;
    color: #ffd93d;
    letter-spacing: -0.05em;
}

.private-note-priority .star-empty {
    color: rgba(255, 255, 255, 0.1);
}

.private-note-section-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(139, 127, 255, 0.1);
    color: var(--color-primary, #8b7fff);
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.private-note-timestamp {
    font-size: 0.7rem;
    color: var(--color-text-secondary, #adb5bd);
}

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

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

.private-note-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--color-text-secondary, #adb5bd);
    cursor: pointer;
    font-size: 0.65rem;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.private-note-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary, #f8f9fa);
}

.private-note-action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.private-note-delete:hover {
    background: rgba(255, 82, 82, 0.15) !important;
    color: #ff5252 !important;
}

.private-note-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--color-text-primary, #f8f9fa);
    word-break: break-word;
}

.private-note-tags {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.private-note-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--color-text-secondary, #adb5bd);
}


/* --- Empty / Loading / Error --- */

.private-notes-empty,
.private-notes-loading,
.private-notes-error {
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-secondary, #adb5bd);
    font-size: 0.85rem;
}

.private-notes-error {
    color: #ff5252;
}


/* --- Responsive --- */

@media (max-width: 767px) {
    .private-notes-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .private-notes-add-btn {
        margin-left: 0;
        justify-content: center;
    }

    .private-notes-form-row {
        flex-direction: column;
    }

    .private-note-actions {
        opacity: 1;
    }
}
