/* TreatyMind - Custom Styles */

/* Legal Document Styling */
.treaty-text {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    font-size: 0.95rem;
    color: #1f2937;
}

.treaty-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

.treaty-text .clause-heading {
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* Clause Highlighting */
.clause {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.clause:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.clause.active {
    box-shadow: 0 0 0 2px currentColor;
}

/* Structure clauses - Blue */
.clause-structure {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
}

.clause-structure:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

/* Coverage clauses - Green */
.clause-coverage {
    background-color: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22c55e;
}

.clause-coverage:hover {
    background-color: rgba(34, 197, 94, 0.2);
}

/* Exclusion clauses - Yellow */
.clause-exclusion {
    background-color: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
}

.clause-exclusion:hover {
    background-color: rgba(234, 179, 8, 0.2);
}

/* Risk clauses - Red */
.clause-risk {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
}

.clause-risk:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

/* Clause type badges */
.clause-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.25rem;
}

.clause-badge-structure {
    background-color: #3b82f6;
    color: white;
}

.clause-badge-coverage {
    background-color: #22c55e;
    color: white;
}

.clause-badge-exclusion {
    background-color: #eab308;
    color: #1f2937;
}

.clause-badge-risk {
    background-color: #ef4444;
    color: white;
}

/* Risk Score Gauge */
.risk-gauge {
    position: relative;
    width: 120px;
    height: 60px;
    overflow: hidden;
}

.risk-gauge-bg {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 60px 60px 0 0;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 50%, #ef4444 100%);
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
    transform: rotate(180deg);
}

.risk-gauge-mask {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100px;
    height: 100px;
    border-radius: 50px 50px 0 0;
    background: white;
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
    transform: rotate(180deg);
}

.risk-gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 50px;
    background: #1f2937;
    transform-origin: bottom center;
    border-radius: 2px;
    transform: translateX(-50%) rotate(0deg);
    transition: transform 0.5s ease;
}

/* Extraction Panel */
.extraction-panel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

.extraction-accordion {
    border-bottom: 1px solid #e2e8f0;
}

.extraction-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.extraction-accordion-header:hover {
    background-color: #f1f5f9;
}

.extraction-accordion-content {
    padding: 0 1rem 1rem 1rem;
    display: none;
}

.extraction-accordion.open .extraction-accordion-content {
    display: block;
}

.extraction-accordion-header .chevron {
    transition: transform 0.2s;
}

.extraction-accordion.open .extraction-accordion-header .chevron {
    transform: rotate(180deg);
}

/* Comparison View */
.comparison-panel {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.comparison-header {
    background-color: #f1f5f9;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.comparison-content {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

/* Diff highlighting */
.diff-added {
    background-color: rgba(34, 197, 94, 0.2);
    border-left: 3px solid #22c55e;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
}

.diff-removed {
    background-color: rgba(239, 68, 68, 0.2);
    border-left: 3px solid #ef4444;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    text-decoration: line-through;
}

.diff-modified {
    background-color: rgba(234, 179, 8, 0.2);
    border-left: 3px solid #eab308;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
}

.diff-unchanged {
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem 0;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

/* Processing Steps */
.processing-step {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.processing-step.active {
    opacity: 1;
}

.processing-step.complete {
    opacity: 1;
}

.processing-step .step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    background-color: #e2e8f0;
}

.processing-step.active .step-icon {
    background-color: #3b82f6;
    color: white;
    animation: pulse 1s infinite;
}

.processing-step.complete .step-icon {
    background-color: #22c55e;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Alert Severity */
.severity-high {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #ef4444;
}

.severity-medium {
    background-color: rgba(234, 179, 8, 0.1);
    border-left: 4px solid #eab308;
}

.severity-low {
    background-color: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #22c55e;
}

/* Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Metric Cards */
.metric-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.metric-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1f2e;
}

.metric-card-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Table Styling */
.treaty-table {
    width: 100%;
    border-collapse: collapse;
}

.treaty-table th {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e2e8f0;
}

.treaty-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.treaty-table tr:hover {
    background-color: #f8fafc;
}

/* Risk Score Pills */
.risk-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.risk-pill-low {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.risk-pill-medium {
    background-color: rgba(234, 179, 8, 0.1);
    color: #a16207;
}

.risk-pill-high {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Animation for loading states */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}
