/* Notes Container - Grid layout like other widget sections */

notes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.notes-container-loading,
.notes-container-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.6);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Note Card - Individual widget card */

.note-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.note-card.priority-high {
    border-left: 3px solid #e74c3c;
}

.note-card.priority-low {
    border-left: 3px solid #3498db;
}

.note-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.note-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.note-card-title-section {
    flex: 1;
    min-width: 0;
}

.note-card-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-card-subtitle {
    font-size: 0.8rem;
    opacity: 0.6;
    margin: 4px 0 0 0;
}

.note-card-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.note-card-edit-btn,
.note-card-delete-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.note-card-edit-btn:hover {
    background: rgba(155, 89, 182, 0.3);
    color: #d4a5e8;
}

.note-card-delete-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

/* Tags */

.note-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.note-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(155, 89, 182, 0.3);
    color: #d4a5e8;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Note body - rendered markdown */

.note-card-body {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.85;
}

.note-card-body p {
    margin: 0 0 0.75em 0;
}

.note-card-body p:last-child {
    margin-bottom: 0;
}

.note-card-body ul, .note-card-body ol {
    margin: 0 0 0.75em 0;
    padding-left: 1.5em;
}

.note-card-body li {
    margin-bottom: 0.25em;
}

.note-card-body code {
    background: rgba(255,255,255,0.1);
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
}

.note-card-body pre {
    background: rgba(0,0,0,0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75em 0;
}

.note-card-body pre code {
    background: none;
    padding: 0;
}

.note-card-body a {
    color: #9b59b6;
    text-decoration: none;
}

.note-card-body a:hover {
    text-decoration: underline;
}

.note-card-body h1, .note-card-body h2, .note-card-body h3, .note-card-body h4 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
}

.note-card-body h1:first-child, .note-card-body h2:first-child, .note-card-body h3:first-child {
    margin-top: 0;
}

.note-card-body blockquote {
    border-left: 3px solid #9b59b6;
    margin: 0.75em 0;
    padding-left: 1em;
    opacity: 0.8;
}

.note-card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
}

.note-card-body th, .note-card-body td {
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px;
    text-align: left;
}

.note-card-body th {
    background: rgba(255,255,255,0.1);
}

/* Edit Modal */

.note-edit-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;
    backdrop-filter: blur(5px);
}

.note-edit-dialog {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}

.note-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.note-edit-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.note-edit-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.note-edit-close:hover {
    color: #ff6b6b;
}

.note-edit-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.note-edit-form label {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: -10px;
}

.note-edit-form input,
.note-edit-form textarea,
.note-edit-form select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
}

.note-edit-form input:focus,
.note-edit-form textarea:focus,
.note-edit-form select:focus {
    outline: none;
    border-color: #9b59b6;
}

.note-edit-form textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.note-edit-form select {
    cursor: pointer;
}

.note-edit-form select option {
    background: #1a1a2e;
}

.note-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.note-edit-cancel,
.note-edit-save {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.note-edit-cancel {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.note-edit-cancel:hover {
    background: rgba(255,255,255,0.2);
}

.note-edit-save {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: #fff;
}

.note-edit-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

/* Touch device adjustments */
@media (hover: none) and (pointer: coarse) {
    .note-card-actions {
        opacity: 1;
    }

    .note-card-edit-btn,
    .note-card-delete-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}
