/* student-notes.css — Styles for the student-facing Notes tab + Quick Add FAB/modal.
   All classes prefixed .sns- (Student NoteS) to avoid conflicts. */

/* ===== Left / Right pages ===== */
.sns-root {
    padding: 16px 20px 40px;
    font-family: inherit;
    color: #333;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100%;
}
.sns-loading, .sns-error {
    padding: 40px 20px;
    text-align: center;
    font-size: 13px;
    color: #666;
}
.sns-error { color: #b91c1c; }

.sns-header { margin-bottom: 14px; }
.sns-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.sns-sub {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* ===== Calendar ===== */
.sns-cal-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 14px;
}
.sns-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.sns-cal-arrow {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #333;
}
.sns-cal-arrow:hover { background: #eef2f5; }
.sns-cal-month {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.sns-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.sns-cal-weekday {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
}
.sns-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.sns-cal-cell {
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    background: #fafafa;
    border: 1px solid transparent;
    height: 30px;
    position: relative;
    cursor: pointer;
    user-select: none;
}
.sns-cal-cell--empty { background: transparent; cursor: default; }
.sns-cal-cell--grey { background: #f4f4f5; color: #bbb; }
.sns-cal-cell--white { background: #fff; border-color: #e5e7eb; color: #444; }
.sns-cal-cell--green {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
    font-weight: 600;
}
.sns-cal-cell--today { box-shadow: inset 0 0 0 2px #2563eb; }
.sns-cal-cell--selected { box-shadow: inset 0 0 0 2px #059669; }
.sns-cal-cell--clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.sns-cal-day { font-size: 12px; line-height: 1; }
.sns-cal-count {
    background: #065f46;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    line-height: 1.2;
}

.sns-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
    color: #666;
}
.sns-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sns-cal-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
}
.sns-cal-swatch--green { background: #d1fae5; border: 1px solid #10b981; }
.sns-cal-swatch--white { background: #fff; border: 1px solid #e5e7eb; }
.sns-cal-swatch--grey { background: #f4f4f5; border: 1px solid #e0e0e0; }

/* ===== Filter bar ===== */
.sns-filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.sns-filter-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    cursor: pointer;
    color: #555;
}
.sns-filter-chip:hover { background: #f0f0f0; }
.sns-filter-chip--active {
    background: #ecfdf5;
    border-color: #059669;
    color: #065f46;
}

/* ===== Day list / note cards ===== */
.sns-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sns-daylist-head {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 4px 0 2px;
}
.sns-daylist-subhead {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 6px 0 2px;
}
.sns-note-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    cursor: pointer;
    transition: box-shadow 0.1s;
}
.sns-note-card:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); }
.sns-note-card--active {
    border-color: #059669;
    box-shadow: inset 0 0 0 1px #059669;
    background: #f0fdf4;
}
.sns-note-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.sns-note-time {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
}
.sns-note-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sns-note-tag--lesson { background: #dbeafe; color: #1e40af; }
.sns-note-tag--general { background: #f3f4f6; color: #4b5563; }
.sns-note-tab {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
}
.sns-note-snippet {
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}
.sns-att-icon {
    font-size: 12px;
    color: #666;
    margin-left: 2px;
}

.sns-empty {
    text-align: center;
    padding: 30px 16px;
    color: #999;
    font-size: 13px;
}
.sns-empty-icon { font-size: 34px; margin-bottom: 8px; }
.sns-empty-title { font-weight: 700; color: #666; font-size: 14px; margin-bottom: 4px; }
.sns-empty-desc { font-size: 12px; color: #999; }
.sns-empty-lite {
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* ===== Right pane detail ===== */
.sns-detail {
    padding: 18px 20px 40px;
    font-family: inherit;
    color: #333;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100%;
}
.sns-detail-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.sns-detail-empty-icon { font-size: 40px; margin-bottom: 10px; }
.sns-detail-empty-title { font-weight: 700; font-size: 14px; color: #666; margin-bottom: 6px; }
.sns-detail-empty-desc { font-size: 12px; line-height: 1.6; max-width: 280px; margin: 0 auto; }

.sns-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.sns-detail-date {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}
.sns-detail-tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sns-detail-actions {
    display: flex;
    gap: 6px;
}

.sns-jump-btn {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sns-jump-btn:hover { background: #dbeafe; }

.sns-detail-content {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.sns-detail-textarea {
    width: 100%;
    min-height: 160px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    box-sizing: border-box;
    resize: vertical;
    line-height: 1.6;
}
.sns-detail-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.sns-detail-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 12px;
}
.sns-att-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px;
    text-align: center;
}
.sns-att-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    cursor: zoom-in;
}
.sns-att-caption {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    word-wrap: break-word;
}

.sns-detail-meta {
    font-size: 11px;
    color: #999;
    margin-top: 14px;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

/* ===== Buttons ===== */
.sns-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
}
.sns-btn-primary {
    background: #059669;
    color: #fff;
    border-color: #047857;
}
.sns-btn-primary:hover { background: #047857; }
.sns-btn-primary:disabled { opacity: 0.6; cursor: default; }
.sns-btn-ghost {
    background: #f8f9fa;
    color: #444;
    border-color: #e0e0e0;
}
.sns-btn-ghost:hover { background: #f0f0f0; }
.sns-btn-danger-ghost {
    background: transparent;
    color: #b91c1c;
    border-color: #fecaca;
}
.sns-btn-danger-ghost:hover { background: #fef2f2; }

/* ===== FAB ===== */
.sns-fab {
    position: fixed;
    bottom: 92px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #059669;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s;
}
.sns-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    background: #047857;
}
.sns-fab-icon {
    font-size: 22px;
    line-height: 1;
}
.sns-fab-plus {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    color: #059669;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* ===== Quick-Add Modal ===== */
.sns-qa-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(17, 24, 39, 0.55);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.sns-qa-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    color: #333;
}
.sns-qa-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
}
.sns-qa-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}
.sns-qa-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
}
.sns-qa-close:hover { color: #111; }

.sns-qa-meta {
    display: flex;
    gap: 10px;
    padding: 12px 18px 4px;
    flex-wrap: wrap;
}
.sns-qa-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}
.sns-qa-field--grow { flex: 1 1 auto; min-width: 200px; }
.sns-qa-label {
    font-size: 10px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sns-qa-input {
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    font-family: inherit;
    color: #333;
}
.sns-qa-input:focus { outline: 2px solid #059669; outline-offset: -1px; }

.sns-qa-context {
    font-size: 11px;
    color: #6b7280;
    padding: 4px 18px 12px;
}

.sns-qa-textarea {
    margin: 0 18px 12px;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    width: calc(100% - 36px);
}
.sns-qa-textarea:focus { outline: 2px solid #059669; outline-offset: -1px; }

.sns-qa-tools {
    display: flex;
    gap: 6px;
    padding: 0 18px 10px;
    flex-wrap: wrap;
}
.sns-qa-tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    color: #333;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
}
.sns-qa-tool:hover { background: #eef2f5; }
.sns-qa-tool--active {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    animation: sns-pulse 1.2s infinite;
}
@keyframes sns-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}
.sns-qa-tool-icon { font-size: 14px; }

.sns-qa-atts {
    padding: 0 18px 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.sns-qa-att {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px;
    text-align: center;
}
.sns-qa-att img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}
.sns-qa-att-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.sns-qa-att-remove:hover { background: rgba(0, 0, 0, 0.75); }
.sns-qa-att-cap {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    word-wrap: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sns-qa-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #eee;
}

/* Phase 14c — Annotations panel inside the Notes tab. */
.sns-ann-panel { margin-top: 18px; padding: 10px 12px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; }
.sns-ann-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sns-ann-head { font-size: 11px; font-weight: 700; color: #9a3412; text-transform: uppercase; letter-spacing: 0.4px; }
.sns-ann-count { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 600; color: #fff; background: #ea580c; padding: 1px 7px; border-radius: 9px; }
.sns-ann-toggle { display: inline-flex; border: 1px solid #fed7aa; border-radius: 6px; overflow: hidden; background: #fff; }
.sns-ann-tab { background: none; border: none; padding: 4px 10px; font-size: 11px; font-weight: 600; color: #9a3412; cursor: pointer; font-family: inherit; }
.sns-ann-tab.is-active { background: #ea580c; color: #fff; }
.sns-ann-empty { font-size: 12px; color: #92400e; font-style: italic; padding: 8px 4px; }
.sns-ann-group { margin-bottom: 10px; }
.sns-ann-grouphead { font-size: 12px; font-weight: 700; color: #7c2d12; padding: 6px 4px; }
.sns-ann-list { display: flex; flex-direction: column; gap: 4px; }
.sns-ann-row { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; background: #fff; border: 1px solid #fed7aa; border-radius: 7px; cursor: pointer; text-align: left; font-family: inherit; width: 100%; }
.sns-ann-row:hover { border-color: #ea580c; background: #fff7ed; }
.sns-ann-dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.05); }
.sns-ann-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sns-ann-book { font-size: 10px; font-weight: 700; color: #9a3412; text-transform: uppercase; letter-spacing: 0.3px; }
.sns-ann-text { font-size: 12px; color: #1f2937; line-height: 1.4; word-break: break-word; }
.sns-ann-meta { font-size: 10px; color: #888; }
