/* ========================================
   CompliTalk - Specialized Components
   ======================================== */

/* ========================================
   FILTER PANEL
   ======================================== */
.filter-panel {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    flex: 1;
    min-width: 15rem;
}

.filter-group.flex-grow {
    flex: 2;
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    margin-bottom: 0.375rem;
    margin-left: 0.25rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.5rem 1rem;
    background: var(--slate-50);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--body-grey);
    transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 95, 51, 0.1);
}

.filter-input-icon {
    position: relative;
}

.filter-input-icon .material-symbols-outlined {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1.25rem;
}

.filter-input-icon input {
    padding-left: 2.5rem;
}

.btn-filter {
    height: 2.5rem;
    padding: 0 1.5rem;
    background: var(--primary-orange);
    color: var(--white);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(255, 95, 51, 0.2);
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: var(--primary-orange-hover);
    transform: translateY(-1px);
}

/* ========================================
   TABS
   ======================================== */
.tabs-container {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tabs {
    display: flex;
    gap: 2rem;
}

.tab-item {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #94A3B8;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-item:hover {
    color: var(--body-grey);
}

.tab-item.active {
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination-wrapper {
    padding: 1rem 1.5rem;
    background: rgba(248, 250, 252, 0.5);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pagination-info {
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
}

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

.pagination-btn {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--body-grey);
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--slate-50);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-number {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--white);
    color: var(--body-grey);
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-number:hover {
    background: var(--slate-100);
}

.pagination-number.active {
    background: var(--primary-orange);
    color: var(--white);
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress-bar-container {
    width: 100%;
    height: 0.625rem;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    background: var(--primary-orange);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar.success {
    background: var(--success-green);
}

.progress-bar.warning {
    background: var(--warning-amber);
}

.progress-bar.danger {
    background: var(--danger-red);
}

/* Language Distribution Bars */
.language-bar-item {
    margin-bottom: 1.5rem;
}

.language-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.language-bar-container {
    width: 100%;
    height: 0.625rem;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.language-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.language-bar.primary {
    background: var(--primary-orange);
}

.language-bar.secondary {
    background: #94A3B8;
}

.language-bar.tertiary {
    background: rgba(255, 95, 51, 0.4);
}

/* ========================================
   CIRCULAR PROGRESS (Compliance Score)
   ======================================== */
.circular-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.circular-progress {
    position: relative;
    width: 4rem;
    height: 4rem;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 6;
}

.circular-progress .bg-circle {
    stroke: var(--slate-100);
}

.circular-progress .progress-circle {
    stroke: var(--primary-orange);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.circular-progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.625rem;
    font-weight: 900;
    color: var(--deep-grey);
}

/* ========================================
   CHART PLACEHOLDERS
   ======================================== */
.chart-container {
    height: 16rem;
    display: flex;
    align-items: flex-end;
    padding: 1rem 0;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(255, 95, 51, 0.05), transparent);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-placeholder svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.625rem;
    font-weight: 900;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.chart-legend-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
}

.chart-legend-dot.primary {
    background: var(--primary-orange);
}

.chart-legend-dot.secondary {
    background: var(--slate-100);
}

/* ========================================
   SPLIT SCREEN LAYOUT (Conversation View)
   ======================================== */
.split-screen-container {
    display: flex;
    gap: 0;
    max-height: calc(100vh - 20rem);
    overflow: hidden;
}

.split-left {
    flex: 1.6;
    background: var(--slate-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.split-divider {
    width: 4px;
    background: var(--silver-grey);
    position: relative;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-divider-handle {
    width: 1rem;
    height: 2.5rem;
    background: var(--silver-grey);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.split-divider-handle .material-symbols-outlined {
    font-size: 0.75rem;
    color: #94A3B8;
}

.split-right {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

/* ========================================
   TRANSCRIPT PANEL
   ======================================== */
.transcript-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transcript-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.transcript-title .material-symbols-outlined {
    color: #94A3B8;
}

.transcript-title h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94A3B8;
}

.transcript-toggle {
    display: flex;
    background: var(--slate-100);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
}

.transcript-toggle button {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.transcript-toggle button.active {
    background: var(--white);
    color: var(--primary-orange);
    box-shadow: var(--shadow-sm);
}

.transcript-toggle button:not(.active) {
    color: #94A3B8;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.transcript-message {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.transcript-message.highlighted {
    background: rgba(255, 95, 51, 0.05);
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--primary-orange);
}

.transcript-timestamp {
    font-size: 0.625rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #94A3B8;
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 2.5rem;
}

.transcript-message-content {
    flex: 1;
}

.transcript-speaker {
    font-size: 0.6875rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.transcript-speaker.agent {
    color: var(--primary-orange);
}

.transcript-speaker.patient {
    color: #64748B;
}

.transcript-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--body-grey);
}

/* ========================================
   COMPLIANCE PANEL
   ======================================== */
.compliance-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--slate-50);
}

.compliance-tab {
    flex: 1;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94A3B8;
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.compliance-tab:hover {
    color: var(--body-grey);
}

.compliance-tab.active {
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
}

.compliance-tab .badge {
    margin-left: 0.5rem;
}

.compliance-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.compliance-item {
    padding: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-100);
    background: rgba(248, 250, 252, 0.5);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.compliance-item:hover {
    box-shadow: var(--shadow-md);
}

.compliance-item.failed {
    background: rgba(255, 95, 51, 0.05);
    border-color: rgba(255, 95, 51, 0.2);
}

.compliance-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.compliance-item-title {
    font-size: 0.875rem;
    font-weight: 900;
    color: var(--deep-grey);
}

.compliance-item-ref {
    font-size: 0.625rem;
    font-weight: 700;
    color: #94A3B8;
    margin-top: 0.125rem;
}

.compliance-item-description {
    font-size: 0.75rem;
    color: #64748B;
    margin-bottom: 1rem;
    font-weight: 500;
}

.compliance-item-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary-orange);
    cursor: pointer;
    transition: all 0.2s ease;
}

.compliance-item-action:hover {
    text-decoration: underline;
}

.compliance-score-section {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--slate-50);
}

.compliance-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.compliance-score-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94A3B8;
}

.compliance-score-value {
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--primary-orange);
}

.compliance-score-note {
    font-size: 0.625rem;
    color: #94A3B8;
    text-align: center;
    margin-top: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ========================================
   AI SUMMARY CARD
   ======================================== */
.ai-summary-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-orange);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.ai-summary-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 95, 51, 0.1);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-summary-icon .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--primary-orange);
}

.ai-summary-content {
    flex: 1;
}

.ai-summary-title {
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--deep-grey);
    margin-bottom: 0.375rem;
}

.ai-summary-text {
    font-size: 0.875rem;
    color: var(--body-grey);
    line-height: 1.6;
    font-style: italic;
}

.ai-summary-action {
    flex-shrink: 0;
}

/* ========================================
   SOP RULE CARDS
   ======================================== */
.sop-category-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sop-category-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sop-category-header.critical {
    background: rgba(239, 68, 68, 0.05);
    border-bottom-color: rgba(239, 68, 68, 0.1);
}

.sop-category-header.high {
    background: rgba(245, 158, 11, 0.05);
    border-bottom-color: rgba(245, 158, 11, 0.1);
}

.sop-category-header.low {
    background: var(--slate-50);
}

.sop-category-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sop-category-title.critical {
    color: var(--danger-red);
}

.sop-category-title.high {
    color: #D97706;
}

.sop-category-title.low {
    color: var(--body-grey);
}

.sop-rule-table {
    width: 100%;
}

.sop-rule-table th {
    padding: 1rem 1.5rem;
    background: rgba(248, 250, 252, 0.5);
    font-size: 0.75rem;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    text-align: left;
}

.sop-rule-table td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--slate-100);
}

.sop-rule-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--deep-grey);
}

.sop-rule-description {
    font-size: 0.75rem;
    color: #94A3B8;
    margin-top: 0.125rem;
}

.sop-rule-criteria {
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    background: var(--slate-50);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--body-grey);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 1rem;
    width: 1rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-orange);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(1.25rem);
}

/* ========================================
   UPLOAD CENTER
   ======================================== */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--slate-50);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-dropzone:hover {
    border-color: var(--primary-orange);
    background: rgba(255, 95, 51, 0.02);
}

.upload-dropzone.dragover {
    border-color: var(--primary-orange);
    background: rgba(255, 95, 51, 0.05);
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: rgba(255, 95, 51, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon .material-symbols-outlined {
    font-size: 2rem;
    color: var(--primary-orange);
}

.upload-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-grey);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: #94A3B8;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-item {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94A3B8;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--primary-orange);
}

.breadcrumb-item.active {
    color: var(--deep-grey);
    font-weight: 700;
    background: var(--slate-100);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.breadcrumb-separator {
    font-size: 0.75rem;
    color: var(--silver-grey);
}

/* ========================================
   SENTIMENT INDICATORS
   ======================================== */
.sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.sentiment-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.sentiment-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-red);
}

.sentiment-badge.neutral {
    background: var(--slate-50);
    color: var(--body-grey);
    border: 1px solid var(--border-color);
}

/* ========================================
   USER AVATAR BADGE
   ======================================== */
.user-badge {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--white);
}

.user-badge.blue {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
}

.user-badge.purple {
    background: linear-gradient(135deg, #A855F7, #9333EA);
}

.user-badge.amber {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.user-badge.emerald {
    background: linear-gradient(135deg, #10B981, #059669);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--slate-50);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--silver-grey);
    border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--border-color-dark);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .split-screen-container {
        flex-direction: column;
    }
    
    .split-left,
    .split-right {
        border-radius: var(--radius-xl);
        border: 1px solid var(--border-color);
    }
    
    .split-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .filter-panel {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
    }
}
