/* Common Detail Panel Styles */
/* Used by: SongDetail, CongregationDetail, TalkDetail, SpeakerDetail, UserDetail, PlanningDetail, InvitationDetail */
/* All detail panels should use the "detail-panel" class on their root element */
/* All detail inner containers should use the "detail-container" class */

/* Detail Panel - applies to all detail panels */
.detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 0;
    width: 100%;
    height: 100%;
}

/* Detail inner container - used as the root inside each detail component */
.detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .detail-container .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: flex-end;
    }

/* Detail Header */
.detail-panel .detail-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    flex-shrink: 0;
}

/* Title row with close button */
.detail-panel .detail-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Actions Container */
.detail-panel .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* Close button */
.detail-panel .btn-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary, #6b7280);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .detail-panel .btn-close:hover {
        color: var(--text-primary, #1f2937);
    }

/* Detail Content - scrollable area */
.detail-panel .detail-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    min-height: 0;
}

/* Form sections inside detail panels */
.detail-panel .form-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    text-transform: uppercase;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

/* Talk Info in Detail */
.talk-info {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.talk-number-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #3b82f6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Speaker Card */
.speaker-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
}

.speaker-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary, #e5e7eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .speaker-avatar svg {
        width: 24px;
        height: 24px;
        color: var(--text-secondary, #6b7280);
    }

.speaker-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .speaker-details .speaker-name {
        font-weight: 600;
        font-size: 1rem;
    }

    .speaker-details .speaker-congregation {
        color: var(--text-secondary, #6b7280);
        font-size: 0.875rem;
    }

    .speaker-details .speaker-email,
    .speaker-details .speaker-phone {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.875rem;
        color: var(--text-secondary, #6b7280);
    }

.contact-icon {
    width: 14px;
    height: 14px;
}

/* Empty Info */
.empty-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
    padding: 0.75rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 4px;
}

    .empty-info .empty-icon {
        width: 16px;
        height: 16px;
        opacity: 0.5;
    }

.empty-info .btn-primary {
    margin-top: 0.5rem;
}

/* Special Event Section */
.special-event-section .special-event-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f5f3ff;
    border-radius: 8px;
    border: 1px solid #ddd6fe;
}

.special-event-icon {
    width: 24px;
    height: 24px;
    color: #7c3aed;
}

/* Special Event Details */
.special-event-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.special-event-name {
    font-weight: 600;
    color: #7c3aed;
    font-size: 1rem;
}

.special-event-dates {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

    .timeline::before {
        content: '';
        position: absolute;
        left: 5px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--border-color, #e5e7eb);
    }

.timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

    .timeline-item:last-child {
        padding-bottom: 0;
    }

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary-color, #3b82f6);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border-color, #e5e7eb);
}

.timeline-item.timeline-canceled .timeline-dot {
    background: #ef4444;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.timeline-label {
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

/* Remarks */
.remarks-input {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.remarks-readonly {
    color: var(--text-primary, #1f2937);
    margin: 0;
}

.remarks-empty {
    color: var(--text-muted, #9ca3af);
    font-style: italic;
    margin: 0;
}

.remarks-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
    color: var(--primary, #4f46e5);
    cursor: default;
}

.remarks-indicator-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* Status Summary (used in InvitationDetail) */
.status-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
    min-width: 80px;
}

.status-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
}

/* Speaker Selection Inline Editing */
.speaker-selection {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 1rem;
}

.speaker-input-group {
    position: relative;
    margin-bottom: 1rem;
}

    .speaker-input-group .speaker-search {
        width: 100%;
        padding: 0.625rem 0.75rem;
        border: 1px solid var(--border-color, #d1d5db);
        border-radius: 6px;
        font-size: 0.875rem;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .speaker-input-group .speaker-search:focus {
            outline: none;
            border-color: var(--primary-color, #3b82f6);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

.speaker-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.speaker-card {
    position: relative;
    padding-right: 6rem;
}

    .speaker-card .btn-edit {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

/* Responsive Styles */
@media (max-width: 768px) {
    .detail-panel {
        width: 100%;
    }

    .detail-panel .detail-header {
        padding: 12px;
    }

    .detail-panel .detail-header h2 {
        font-size: 16px;
    }

    .detail-panel .detail-content {
        padding: 16px;
    }
}

/* Remarks History */
.remarks-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.remarks-entry {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fafafa;
}

.remarks-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.remarks-entry-header .remarks-date {
    font-size: 0.8rem;
    color: #666;
}

.remarks-entry-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: start;
}

.remarks-content {
    min-width: 0;
}

.remarks-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.remarks-actions .btn {
    padding: 2px 6px;
    font-size: 0.75rem;
}

.remarks-text {
    font-size: 0.9rem;
    color: #333;
    white-space: pre-wrap;
}

.remarks-edit-input {
    width: 100%;
    min-height: 60px;
    font-size: 0.9rem;
    resize: vertical;
}
