/* Contact Record View Modal Styles */

.contact-view-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contact-view-modal .modal-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.contact-view-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.contact-view-modal .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.contact-view-modal .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.contact-view-modal .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.contact-view-modal .modal-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Loading and Error States */
.contact-view-modal .loading-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.contact-view-modal .error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Record Content */
.record-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.record-header-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 12px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item.full-width {
    flex: 1 1 100%;
}

.info-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 0.95rem;
    color: #212529;
}

/* Badges */
.session-type-badge {
    display: inline-block;
    background: #ec5f59;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.attendance-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.attendance-present {
    background: #d4edda;
    color: #155724;
}

.attendance-absent {
    background: #f8d7da;
    color: #721c24;
}

.attendance-cancelled {
    background: #fff3cd;
    color: #856404;
}

.attendance-late {
    background: #ffeeba;
    color: #856404;
}

.group-badge {
    display: inline-block;
    background: #e2e3ff;
    color: #ec5f59;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Participants List */
.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.participant-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
}

.loading-participants {
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
}

/* SOAP Notes Section */
.soap-notes-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
}

.soap-notes-section h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #ec5f59;
    padding-bottom: 8px;
}

.soap-note {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.soap-note:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.soap-note label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ec5f59;
    margin-bottom: 6px;
}

.note-content {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #212529;
    white-space: pre-wrap;
}

.empty-notes {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Legacy Notes Section */
.legacy-notes-section {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 16px;
}

.legacy-notes-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f57c00;
}

/* Signature Section */
.signature-section {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 16px;
}

.signature-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2e7d32;
}

.signature-info {
    display: flex;
    gap: 30px;
}

.signature-info .signed {
    color: #2e7d32;
    font-weight: 600;
}

.signature-info .unsigned {
    color: #c62828;
}

.signature-info .signer-name {
    font-weight: 600;
    color: #2e7d32;
}

/* Metadata Section */
.metadata-section {
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.metadata-section .info-item label {
    font-size: 0.7rem;
}

.metadata-section .info-item span {
    font-size: 0.85rem;
    color: #6c757d;
}

.record-id {
    font-family: monospace;
}

/* Buttons */
.contact-view-modal .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.contact-view-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.contact-view-modal .btn-secondary:hover {
    background: #5a6268;
}


/* Documents Section */
.documents-section {
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    padding: 16px;
}

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.documents-section h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1565c0;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.document-icon {
    font-size: 1.5rem;
}

.document-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.document-name {
    font-weight: 500;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.document-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.loading-documents {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.empty-documents {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

/* Button styles for documents section */
.contact-view-modal .btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.contact-view-modal .btn-primary {
    background: #ec5f59;
    color: white;
}

.contact-view-modal .btn-primary:hover {
    background: #5a6fd6;
}

.contact-view-modal .btn-danger {
    background: #fde8e8;
    color: #c53030;
}

.contact-view-modal .btn-danger:hover {
    background: #c82333;
}

/* Document Upload Modal Styles */
.document-upload-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.document-upload-modal .modal-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-upload-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.document-upload-modal .modal-body {
    padding: 20px;
    flex: 1;
}

.document-upload-modal .modal-footer {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.document-upload-modal .form-group {
    margin-bottom: 16px;
}

.document-upload-modal .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.document-upload-modal .form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
}

.document-upload-modal .form-group input[type="file"]:hover {
    border-color: #ec5f59;
    background: #f0f4ff;
}

.document-upload-modal .form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 0.85rem;
}

.document-upload-modal .file-info {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.document-upload-modal .file-info p {
    margin: 4px 0;
    color: #2e7d32;
}

.document-upload-modal .error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.document-upload-modal .upload-progress {
    text-align: center;
    color: #ec5f59;
    padding: 12px;
}

.document-upload-modal .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.document-upload-modal .btn-secondary {
    background: #6c757d;
    color: white;
}

.document-upload-modal .btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.document-upload-modal .btn-primary {
    background: #ec5f59;
    color: white;
}

.document-upload-modal .btn-primary:hover:not(:disabled) {
    background: #5a6fd6;
}

.document-upload-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Full-page mode for new browser tab */
.contact-view-fullpage {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background: #f5f7fa;
    padding: 0;
}

.contact-view-fullpage-inner {
    background: white;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.contact-view-fullpage-inner .modal-header {
    background: linear-gradient(135deg, #ec5f59 0%, #D4605A 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.contact-view-fullpage-inner .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.contact-view-fullpage-inner .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.contact-view-fullpage-inner .modal-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.contact-view-fullpage-inner .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
}

.contact-view-fullpage-inner .close-btn:hover {
    opacity: 0.8;
}
