/* CP Task Activity Styles */

.cp-task-activity-section {
    margin-top: 20px;
}

/* Loading text */
.cp-activity-loading {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Collapsible header (no container styling) */
.cp-notes-activity-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    margin-top: 0px;
    padding: 0;
    background: none;
    border: none;
}

.cp-notes-activity-header:hover {
    background: none;
}

.cp-notes-activity-header h4 {
    margin: 0;
    color: #741f11;
    font-size: 16px;
}

.cp-notes-toggle-icon {
    font-size: 18px;
    font-weight: normal;
    color: #741f11;
    display: inline-block;
    line-height: 1;
    transition: transform 0.3s ease;
    font-family: Arial, sans-serif;
}

.cp-notes-activity-header.open .cp-notes-toggle-icon {
    transform: translateY(-5px) rotate(-90deg);
}

.cp-activity-header {
    background: transparent;
    padding: 0;
    border: none;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 10px;
    flex-wrap: nowrap !important;
    width: 100%;
    flex-direction: row !important;
}

.cp-activity-controls {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.cp-activity-actions {
    display: flex !important;
    gap: 10px;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* Activity header button overrides - specific sizing for activity context */
.cp-activity-header .cp-activity-actions .cp-meeting-btn {
    width: auto !important;
    min-width: 60px !important;
    max-width: 80px !important;
    min-height: 32px !important;
    gap: 4px !important;
}

/* Add Note Modal */
:root {
    --cp-font-family: Arial, Helvetica, sans-serif;
}

.cp-add-note-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--cp-font-family, Arial, Helvetica, sans-serif);
}

.cp-add-note-modal-content {
    background: var(--cp-gradient-moderate-blue) !important;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: var(--cp-font-family, Arial, Helvetica, sans-serif);
}

.cp-add-note-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cp-add-note-modal-header h3 {
    margin: 0 !important;
    color: #741f11;
    font-size: 16px;
}

.cp-add-note-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-add-note-modal-close:hover {
    color: #741f11;
}

.cp-add-note-modal-body {
    padding: 12px 16px;
}

.cp-add-note-modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Add note modal button overrides - specific sizing for modal context */
.cp-add-note-modal .cp-meeting-btn,
.cp-add-note-modal .cp-button-primary,
.cp-add-note-modal .cp-button-secondary {
    min-width: 80px !important;
    max-width: 80px !important;
    gap: 4px !important;
    font-size: 14px !important;
}

/* Override mobile.css button rules for Add Note modal - exclude close button */
.cp-add-note-modal button:not(.cp-add-note-modal-close),
.cp-add-note-modal input[type="submit"],
.cp-add-note-modal input[type="button"] {
    width: auto !important;
    max-width: none !important;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    margin-bottom: 0 !important;
}

/* Specific overrides for modal close button */
.cp-add-note-modal-close {
    width: 24px !important;
    max-width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cp-add-note-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.cp-add-note-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #741f11;
}

.cp-add-note-form textarea {
    width: 100%;
    margin-bottom: 10px;
}

/* Integration with committee form styling */
.cp-add-note-form .cp-form-textarea {
    width: 100%;
    margin-bottom: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    resize: vertical;
    min-height: 80px;
}

.cp-add-note-form .cp-form-textarea:focus {
    border-color: #741f11;
    outline: none;
    box-shadow: 0 0 0 2px rgba(116, 31, 17, 0.2);
}

.cp-add-note-form .cp-meeting-btn {
    margin-top: 10px;
}

.cp-add-note-form .cp-form-actions {
    margin-top: 10px;
    padding: 0;
}

.cp-activity-controls label {
    font-weight: normal;
    cursor: pointer;
    margin: 0;
}

.cp-activity-controls input[type="checkbox"] {
    margin-right: 5px;
}

.cp-activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.cp-activity-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.cp-activity-item:last-child {
    border-bottom: none;
}

/* User Notes Styling - Compact */
.cp-activity-item.cp-user-note {
    background: #fff;
    border-left: 4px solid #741f11;
    padding: 8px 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cp-activity-item.cp-user-note .cp-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.cp-activity-item.cp-user-note .cp-activity-author {
    font-weight: bold;
    color: #741f11;
    font-size: 13px;
}

.cp-activity-item.cp-user-note .cp-activity-time {
    font-size: 11px;
    color: #666;
}

.cp-activity-item.cp-user-note .cp-activity-content {
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

/* User photo styling */
.cp-activity-photo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
}

.cp-activity-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
}

.cp-photo-placeholder {
    width: 24px;
    height: 28px;
    position: relative;
    display: block;
}

.cp-photo-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #ddd;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cp-photo-placeholder::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 14px;
    background: #ddd;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Override the head and shoulders styling for gradient initials */
.cp-photo-placeholder.cp-gradient-initials::before,
.cp-photo-placeholder.cp-gradient-initials::after {
    display: none;
}

.cp-activity-content-wrapper {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

/* Gradient initials placeholder */
.cp-photo-placeholder.cp-gradient-initials {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #741f11, #2c5aa0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Description Field Styling */
.cp-description-field {
    position: relative;
}


/* Note: Edit button styles moved to action-log.css to avoid conflicts */

/* System Changes Styling - Compact */
.cp-activity-item.cp-system-change {
    background: #f8f8f8;
    border-left: 4px solid #ccc;
    font-size: 11px;
    padding: 6px 10px;
    margin-bottom: 4px;
}

.cp-activity-item.cp-system-change .cp-activity-header {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.cp-activity-item.cp-system-change .cp-activity-icon {
    margin-right: 5px;
    font-size: 14px;
}

.cp-activity-item.cp-system-change .cp-activity-type {
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.cp-activity-item.cp-system-change .cp-activity-time {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.cp-activity-item.cp-system-change .cp-activity-content {
    font-style: italic;
    color: #666;
    margin-left: 20px;
}

.cp-activity-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Activity loading overrides - specific styling for activity context */
.cp-activity-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.cp-activity-loading:before {
    content: "⏳";
    margin-right: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cp-activity-item.cp-user-note .cp-activity-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cp-activity-item.cp-user-note .cp-activity-time {
        margin-top: 5px;
    }
    
    .cp-activity-item.cp-system-change .cp-activity-header {
        flex-wrap: wrap;
    }
    
    .cp-activity-item.cp-system-change .cp-activity-time {
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
    }
}

/* Mobile-specific overrides for Add Note modal */
@media screen and (max-width: 767px) {
    /* Override mobile.css button rules specifically for Add Note modal - exclude close button */
    .cp-add-note-modal button:not(.cp-add-note-modal-close),
    .cp-add-note-modal input[type="submit"],
    .cp-add-note-modal input[type="button"] {
        width: auto !important;
        max-width: none !important;
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        margin-bottom: 0 !important;
    }
    
    /* Ensure modal header doesn't wrap */
    .cp-add-note-modal-header {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }
    
    /* Keep close button compact */
    .cp-add-note-modal-close {
        width: 24px !important;
        max-width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
    }
    
    /* Ensure modal title doesn't take up too much space */
    .cp-add-note-modal-header h3 {
        flex: 1 !important;
        min-width: 0 !important;
        margin-right: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}
