/* Contact Record Modal Styles */

.contact-record-modal {
    max-width: 800px !important;
    max-height: 90vh;
    overflow-y: auto;
}

.contact-record-modal h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #372562;
}

.contact-record-form {
    padding: 0;
}

.contact-record-modal .form-group {
    margin-bottom: 20px;
}

.contact-record-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.contact-record-modal input[type="text"],
.contact-record-modal input[type="date"],
.contact-record-modal select,
.contact-record-modal textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.contact-record-modal textarea {
    resize: vertical;
    min-height: 80px;
}

.contact-record-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.contact-record-modal .checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* SOAP Section */
.soap-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.soap-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

/* Selected Pupils */
.selected-pupils {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pupil-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e3f2fd;
    border-radius: 16px;
    font-size: 14px;
}

/* Primary pupil styling - visually distinct */
.pupil-chip.primary-pupil {
    background: #ec5f59;
    color: white;
    font-weight: 600;
    border: 2px solid #5568d3;
}

.pupil-chip .remove-chip {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Primary pupil remove button styling */
.pupil-chip.primary-pupil .remove-chip {
    color: rgba(255, 255, 255, 0.8);
}

.pupil-chip .remove-chip:hover {
    color: #d32f2f;
}

.pupil-chip.primary-pupil .remove-chip:hover {
    color: #ffcdd2;
}

/* Targets List */
.targets-list {
    margin-top: 10px;
}

.target-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
}

.target-item span {
    flex: 1;
}

.target-item .btn-remove {
    padding: 4px 12px;
    font-size: 12px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.target-item .btn-remove:hover {
    background: #d32f2f;
}

/* Documents List */
.documents-list {
    margin-top: 10px;
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 8px;
    gap: 10px;
}

.document-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-item .btn-download {
    padding: 4px 12px;
    font-size: 12px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.document-item .btn-download:hover {
    background: #1976d2;
}

/* Signature Section */
.signature-section {
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffc107;
}

.signature-timestamp {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Empty State */
.empty-state {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Error Message */
.error-message {
    padding: 10px;
    background: #ffebee;
    color: #c62828;
    border-radius: 4px;
    margin-top: 10px;
}

/* Pupil Selector Modal */
.pupil-selector-modal {
    max-width: 500px;
}

.pupils-list {
    max-height: 400px;
    overflow-y: auto;
}

.pupil-item {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.pupil-item:hover {
    background: #f5f5f5;
}

.pupil-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.school-name {
    font-size: 12px;
    color: #666;
}

/* Target Selector Modal */
.target-selector-modal {
    max-width: 600px;
}

.target-selector-modal .targets-list {
    max-height: 400px;
    overflow-y: auto;
}

.target-selector-modal .target-item {
    cursor: pointer;
    transition: background 0.2s;
}

.target-selector-modal .target-item:hover {
    background: #e8e8e8;
}

.target-description {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.target-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.target-status.status-active {
    background: #c8e6c9;
    color: #2e7d32;
}

.target-status.status-completed {
    background: #bbdefb;
    color: #1565c0;
}

.target-status.status-paused {
    background: #fff9c4;
    color: #f57f17;
}

/* Document Upload Modal */
.document-upload-modal {
    max-width: 500px;
}

/* Staged Files Section (for new records) */
.staged-files-section {
    margin-top: 5px;
}

.staged-files-list {
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.staged-file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    gap: 8px;
}

.staged-file-item:last-child {
    border-bottom: none;
}

.staged-file-item .file-icon {
    font-size: 16px;
}

.staged-file-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.staged-file-item .file-size {
    color: #666;
    font-size: 12px;
}

.staged-file-item .btn-remove-staged {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.staged-file-item .btn-remove-staged:hover {
    color: #d32f2f;
}

/* Upload Progress Bar */
.upload-progress-container {
    position: relative;
    width: 100px;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-left: 8px;
}

.upload-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #ec5f59, #D4605A);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.upload-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #333;
    z-index: 1;
}

.file-info {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-top: 10px;
}

.file-info p {
    margin: 5px 0;
}

.upload-progress {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Buttons */
.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-primary {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-record-modal {
        max-width: 95%;
        margin: 10px;
    }
}
