﻿/* Notes Table Styles */

/* Section separators */
.knowledge-separator,
.download-separator,
.module-separator {
    border-top: 1px dashed #ccc;
    margin: 10px 0;
}

/* Common section spacing */
.knowledge-base-section,
.download-section,
.module-section {
    margin-top: 0.5rem;
}

/* Unified styles for Knowledge Base, Download, Module sections - all blue */
.knowledge-badge,
.download-badge,
.module-badge {
    background-color: #E3F2FD;
    color: #0D47A1;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 85%;
    margin-right: 8px;
}

.knowledge-link,
.download-link,
.module-link {
    color: #1565C0;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 0.5rem;
}

.knowledge-link:hover,
.download-link:hover,
.module-link:hover {
    text-decoration: underline;
}

/* Icon spacing */
.fa-book-open,
.fa-file-download,
.fa-link,
.fa-external-link-alt,
.fa-download,
.fa-arrow-right {
    margin-right: 4px;
}

.fa-external-link-alt,
.fa-download,
.fa-arrow-right {
    font-size: 85%;
}

/* Add Note button styles */
.btn-add-note {
    background-color: #f8f9fa;
    border: 1px solid #6c757d;
    color: #495057;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    float: right;
    margin-bottom: 10px;
    margin-right: 0;
    font-weight: 500;
}

.btn-add-note:hover {
    background-color: #e2e6ea;
    border-color: #495057;
    color: #212529;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-add-note i {
    font-size: 12px;
    margin-right: 5px;
    color: #1565C0;
}

.card-header {
    background-color: transparent;
    border-bottom: none;
    padding: 10px 15px 0 15px;
}

.card-body {
    padding: 0 15px 15px 15px;
}

/* Category badges - all unified blue, differentiated by icon, fixed width */
.badge-general,
.badge-cleaning,
.badge-cargo,
.badge-handling,
.badge-safety,
.badge-coating {
    background-color: #104E8B;
    color: white;
    display: inline-flex;
    align-items: center;
    width: 85px;
    text-align: left;
    padding-left: 8px;
}

.badge-general i,
.badge-cleaning i,
.badge-cargo i,
.badge-handling i,
.badge-safety i,
.badge-coating i {
    width: 14px;
    margin-right: 6px;
    flex-shrink: 0;
}

.note-content p {
    margin: 0 0 0.5em 0;
}

.note-content p:last-child {
    margin-bottom: 0;
}

/* User notes - highlighted with left border */
tr.user-note {
    border-left: 3px solid #28a745;
}

/* Title cell - simple block display, no click behavior */
.note-title-cell {
    min-width: 140px;
    cursor: default;
}

.note-title-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.note-title-row i {
    flex-shrink: 0;
}

.note-title-row strong {
    font-weight: 600;
}

.note-global-badge {
    margin-top: 4px;
}

/* Edit link style */
.note-actions {
    width: 50px;
}

.edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #0d6efd;
    border-radius: 4px;
    transition: all 0.15s;
}

.edit-link:hover {
    background: #e7f1ff;
    color: #0b5ed7;
    text-decoration: none;
}

.edit-link i {
    font-size: 14px;
}

/* Attachment info in content cell */
.attachment-info {
    margin-top: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.attachment-info a {
    color: #0d6efd;
    text-decoration: none;
}

.attachment-info a:hover {
    text-decoration: underline;
}

.attachment-info i {
    margin-right: 4px;
}

/* Global note styles */
tr.global-note {
    background-color: #f0f8ff !important;
    border-left: 3px solid #17a2b8;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* Utility classes */
.clearfix {
    clear: both;
}

.ml-5 {
    margin-left: 5px;
}

/* ==========================================================================
   Notes Card Design (replaces table layout)
   ========================================================================== */

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Note Card Base */
.note-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    padding: 16px 20px;
}

/* User note variant - blue left border */
.note-card--user {
    border-left: 4px solid #0077cc;
}

/* Card Header */
.note-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    gap: 12px;
}

.note-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* Blue dot indicator for user notes */
.note-card__user-indicator {
    width: 10px;
    height: 10px;
    background-color: #0077cc;
    border-radius: 50%;
    flex-shrink: 0;
}

.note-card__topic {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
}

/* Warning icon */
.note-card__warning-icon {
    color: #dc3545;
    font-size: 14px;
    flex-shrink: 0;
}

.note-card__warning-icon--yellow {
    color: #ffc107;
}

/* Actions area (edit + badge) */
.note-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.note-card__edit-btn {
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.note-card__edit-btn:hover {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
    text-decoration: none;
}

/* Category Badges */
.note-card__category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    background: #0077cc;
    color: #fff;
}

/* Card Content */
.note-card__content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
    white-space: pre-line;
}

.note-card__content p {
    margin: 0 0 8px 0;
}

.note-card__content p:first-child {
    margin-top: 0 !important;
}

.note-card__content p:last-child {
    margin-bottom: 0;
}

/* Collapsible Content Wrapper */
.note-card__content-wrapper {
    position: relative;
}

.note-card__content-wrapper--collapsible {
    max-height: 50px;
    overflow: hidden;
}

.note-card__content-wrapper--collapsible.expanded {
    max-height: none;
}

/* Fade overlay for collapsed content */
.note-card__fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.note-card__content-wrapper--collapsible.expanded .note-card__fade-overlay {
    display: none;
}

/* Toggle Button */
.note-card__toggle-btn {
    background: none;
    border: none;
    color: #1565C0;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
}

.note-card__toggle-btn:hover {
    text-decoration: underline;
}

.note-card__toggle-btn .toggle-arrow {
    margin-right: 4px;
}

/* Attachment */
.note-card__attachment {
    margin-top: 10px;
}

.note-card__attachment a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0066cc;
    font-size: 13px;
    text-decoration: none;
}

.note-card__attachment a:hover {
    text-decoration: underline;
}

.note-card__attachment i {
    color: #6c757d;
}

/* Links (Knowledge Base, Download, Module) */
.note-card__link {
    margin-top: 8px;
}

.note-card__link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0066cc;
    font-size: 13px;
    text-decoration: none;
}

.note-card__link a:hover {
    text-decoration: underline;
}

.note-card__link i {
    font-size: 12px;
}

/* Global Badge */
.note-card__global-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    background: #17a2b8;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
