/**
 * AI Content Detector Frontend Styles
 * Matching the mockup design
 */

/* Tool Container - Optimized for minimal whitespace */
.acd-tool-container {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 1600px);
    margin: 0 auto;
    padding: 0 max(1rem, env(safe-area-inset-left));
    animation: fadeInScale 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    container-type: inline-size;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Tool Card - Reduced padding, better fit */
.acd-tool-card {
    background: white;
    border-radius: clamp(12px, 2vw, 24px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    padding: clamp(1.25rem, 3vw, 3rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    width: 100%;
    box-sizing: border-box;
}

/* Container queries for responsive scaling */
@container (max-width: 480px) {
    .acd-tool-card {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .acd-section-title {
        font-size: 1rem;
    }
    
    .acd-content-textarea {
        min-height: 100px;
        height: 120px;
    }
}

@container (min-width: 481px) and (max-width: 768px) {
    .acd-tool-card {
        padding: 1.5rem;
    }
    
    .acd-content-textarea {
        height: 140px;
    }
}

@container (min-width: 769px) and (max-width: 1024px) {
    .acd-tool-card {
        padding: 2rem;
    }
    
    .acd-content-textarea {
        height: 160px;
    }
}

@container (min-width: 1025px) {
    .acd-tool-card {
        padding: 2.5rem;
    }
    
    .acd-content-textarea {
        height: 180px;
    }
}

/* Viewport-based responsive adjustments */
@media screen and (max-width: 640px) {
    .acd-tool-container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media screen and (min-width: 641px) and (max-width: 1024px) {
    .acd-tool-container {
        max-width: min(calc(100vw - 3rem), 900px);
    }
}

@media screen and (min-width: 1025px) and (max-width: 1440px) {
    .acd-tool-container {
        max-width: min(calc(100vw - 4rem), 1200px);
    }
}

@media screen and (min-width: 1441px) {
    .acd-tool-container {
        max-width: min(calc(100vw - 6rem), 1400px);
    }
}

/* Ultra-wide screens */
@media screen and (min-aspect-ratio: 21/9) {
    .acd-tool-container {
        max-width: min(70vw, 1600px);
    }
}

/* High density displays */
@media screen and (min-resolution: 2dppx) {
    .acd-tool-card {
        box-shadow: 0 12px 35px -12px rgba(0, 0, 0, 0.18);
    }
}

/* URL Section - Reduced spacing */
.acd-url-section {
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.acd-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.acd-section-title {
    font-size: clamp(1rem, calc(0.95rem + 0.25vw), 1.25rem);
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.acd-url-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.acd-url-input {
    flex: 1;
    padding: clamp(0.75rem, calc(0.7rem + 0.3vw), 1rem);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: clamp(0.875rem, calc(0.85rem + 0.15vw), 1rem);
    transition: all 0.2s;
}

.acd-url-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.acd-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.acd-btn-secondary:hover {
    background: #e2e8f0;
}

.acd-help-text {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* Divider - Reduced margin */
.acd-divider {
    position: relative;
    margin: clamp(1.25rem, 2.5vw, 2rem) 0;
    text-align: center;
}

.acd-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.acd-divider-text {
    background: white;
    padding: 0 0.75rem;
    color: #64748b;
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.875rem);
    position: relative;
    display: inline-block;
}

/* Textarea Section - Optimized height */
.acd-textarea-container {
    position: relative;
}

.acd-content-textarea {
    width: 100%;
    min-height: 120px;
    height: clamp(140px, 20vh, 200px);
    padding: clamp(0.75rem, calc(0.7rem + 0.3vw), 1rem);
    padding-right: 3rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    resize: vertical;
    font-size: clamp(0.875rem, calc(0.85rem + 0.15vw), 1rem);
    font-family: inherit;
    transition: all 0.2s;
}

.acd-content-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.acd-paste-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.acd-paste-btn:hover {
    background: #bfdbfe;
}

.acd-paste-btn svg {
    width: 20px;
    height: 20px;
}

/* Word Count */
.acd-word-count {
    display: flex;
    justify-content: flex-end;
    font-size: clamp(0.75rem, calc(0.7rem + 0.2vw), 0.875rem);
    margin-top: 0.5rem;
}

#acd-word-limit {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #e0f2fe;
}

#acd-word-limit.warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
    animation: pulse-warning 1.5s ease-in-out infinite;
}

#acd-word-limit.danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
    animation: pulse-danger 1s ease-in-out infinite;
}

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

@keyframes pulse-danger {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Analyze Button */
.acd-analyze-btn {
    display: block;
    width: auto;
    margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
    background: #2563eb;
    color: white;
    padding: clamp(0.875rem, calc(0.8rem + 0.4vw), 1.125rem) clamp(2rem, 4vw, 3.5rem);
    border: none;
    border-radius: 12px;
    font-size: clamp(1rem, calc(0.95rem + 0.3vw), 1.25rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.acd-analyze-btn:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.acd-analyze-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.acd-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: acd-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes acd-spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.acd-results {
    padding: 3rem;
    margin: 3rem 0;
    padding-bottom: 1rem;
    background: linear-gradient(to bottom, #f8fafc, white);
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    display: none;
    position: relative;
    z-index: 10;
    animation: slideIn 0.5s ease-out;
}

div#acd-plagiarism-risk {
    margin-bottom: 1.5rem;
}

.acd-results.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.acd-results-container {
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1rem;
}

.acd-result-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    padding: 2rem;
    margin-bottom: 2rem;
}

.acd-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.acd-result-header svg {
    color: #2563eb;
    width: 24px;
    height: 24px;
}

.acd-result-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
}

.acd-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: center;
}

.acd-percentage-display {
    text-align: center;
}

.acd-percentage-number {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1;
}

/* AI Detection - Red colors */
.acd-percentage-number.ai-high {
    color: #dc2626; /* Dark red for high AI (70%+) */
}

.acd-percentage-number.ai-medium {
    color: #ef4444; /* Medium red for moderate AI (50-70%) */
}

/* Human Detection - Green colors */
.acd-percentage-number.human-high {
    color: #059669; /* Dark green for high human (70%+) */
}

.acd-percentage-number.human-medium {
    color: #10b981; /* Medium green for moderate human (50-70%) */
}

/* Mixed - Yellow/Orange */
.acd-percentage-number.mixed {
    color: #f59e0b; /* Orange for 50/50 */
}

/* Legacy support */
.acd-percentage-number.ai-low {
    color: #10b981;
}

.acd-percentage-label {
    font-size: 1.25rem;
    font-weight: 500;
    color: #475569;
}

/* Progress Bars */
.acd-progress-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.acd-progress-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.acd-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.acd-progress-label {
    color: #64748b;
}

.acd-progress-value {
    font-weight: 500;
    color: #1e293b;
}

.acd-progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.acd-progress-fill {
    height: 100%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.acd-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.acd-progress-ai {
    background: linear-gradient(90deg, #dc2626, #ef4444);
}

.acd-progress-human {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Summary Box */
.acd-summary-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.acd-summary-box.human {
    background: #f0fdf4;
    border-color: #86efac;
}

.acd-summary-box.mixed {
    background: #fefce8;
    border-color: #fde047;
}

.acd-summary-title {
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.acd-summary-box.human .acd-summary-title {
    color: #14532d;
}

.acd-summary-box.mixed .acd-summary-title {
    color: #713f12;
}

.acd-summary-text {
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.6;
}

.acd-summary-box.human .acd-summary-text {
    color: #166534;
}

.acd-summary-box.mixed .acd-summary-text {
    color: #854d0e;
}

/* Error and Info Messages */
.acd-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.acd-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}


.acd-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.acd-alert-warning {
    background: #fefce8;
    border: 1px solid #fde047;
    color: #854d0e;
}

/* Mobile-specific optimizations */
@media (max-width: 640px) {
    .acd-url-input-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .acd-btn-secondary {
        width: 100%;
        padding: 0.875rem 1.25rem;
    }

    .acd-result-grid {
        grid-template-columns: 1fr;
    }

    .acd-percentage-number {
        font-size: 3rem;
    }

    .acd-analyze-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .acd-help-text {
        font-size: 0.8125rem;
    }
    
    .acd-paste-btn {
        width: 32px;
        height: 32px;
        right: 0.75rem;
        top: 0.75rem;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .acd-percentage-number {
        font-size: 3.5rem;
    }
    
    .acd-url-input-group {
        gap: 0.75rem;
    }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
    .acd-percentage-number {
        font-size: 4.5rem;
    }
}

/* Smooth transitions for all responsive changes */
@media (prefers-reduced-motion: no-preference) {
    .acd-tool-container,
    .acd-tool-card,
    .acd-content-textarea,
    .acd-analyze-btn {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Print styles */
@media print {
    .acd-tool-container {
        max-width: 100%;
    }
    
    .acd-tool-card {
        box-shadow: none;
        border: 2px solid #000;
    }
}

/* Sentence Analysis */
#acd-sentence-analysis {
    display: none;
}

.acd-sentence-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    justify-content: center;
    border-radius: 8px;
    flex-wrap: wrap;
}

.acd-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.acd-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.acd-legend-color.human {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.acd-legend-color.mixed {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.acd-legend-color.ai {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.acd-sentences-container {
    line-height: 2;
    font-size: 1rem;
    color: #1e293b;
}

.acd-sentence {
    display: inline;
    padding: 0.25rem 0.375rem;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: help;
    position: relative;
}

.acd-sentence.human {
    background: rgba(16, 185, 129, 0.15); /* Dark green bg for strong human (70%+) */
    color: #065f46;
}

.acd-sentence.human-moderate {
    background: rgba(52, 211, 153, 0.12); /* Light green bg for moderate human (30-70%) */
    color: #047857;
}

.acd-sentence.mixed {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.acd-sentence.ai {
    background: rgba(220, 38, 38, 0.15);
    color: #991b1b;
}

.acd-sentence:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.acd-sentence-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
    margin-bottom: 0.5rem;
}

.acd-sentence-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.acd-sentence:hover .acd-sentence-tooltip {
    opacity: 1;
}

.acd-no-sentence-data {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Statistics Grid */
.acd-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.acd-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.acd-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.acd-stat-content {
    flex: 1;
}

.acd-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.25rem;
}

.acd-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

/* Cached Badge */
.acd-cached-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.acd-cached-badge svg {
    width: 14px;
    height: 14px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Analysis Table Styles */
.acd-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.acd-analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.acd-analysis-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.acd-analysis-table thead th:nth-child(2),
.acd-analysis-table thead th:nth-child(3) {
    text-align: center;
}

.acd-table-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.acd-table-row:hover {
    background: #f8fafc;
}

.acd-analysis-table td {
    padding: 1rem;
    vertical-align: top;
}

.acd-feature-name {
    font-weight: 500;
    color: #1e293b;
}

.acd-score-cell {
    text-align: center;
}

.acd-score-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.acd-score-high {
    background: #fef2f2;
    color: #dc2626;
}

.acd-score-medium {
    background: #fefce8;
    color: #ca8a04;
}

.acd-score-low {
    background: #f0fdf4;
    color: #16a34a;
}

.acd-flag-cell {
    text-align: center;
}

.acd-flag-icon {
    width: 20px;
    height: 20px;
}

.acd-flag-high {
    color: #dc2626;
}

.acd-flag-medium {
    color: #ca8a04;
}

.acd-flag-low {
    color: #16a34a;
}

.acd-details-cell {
    color: #64748b;
    line-height: 1.5;
}

/* Highlighted Sections */
.acd-highlighted-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.acd-highlighted-item {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: 1rem;
}

.acd-highlighted-text {
    font-style: italic;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.acd-highlighted-reason {
    font-size: 0.875rem;
    color: #65a30d;
}

/* Results Grid */
.acd-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .acd-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.acd-risk-assessment-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Suggestions Styles */
.acd-suggestions-list {
    list-style: none;
    margin-top: 1rem;
    padding: 0;
}

.acd-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    color: #475569;
}

.acd-suggestion-bullet {
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
    margin-top: 8px;
    flex-shrink: 0;
}

/* Risk Assessment Styles */
.acd-risk-card {
    margin-bottom: 0;
}

.acd-risk-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.acd-risk-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.acd-risk-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.acd-risk-high {
    background: #fef2f2;
    color: #dc2626;
}

.acd-risk-medium {
    background: #fefce8;
    color: #ca8a04;
}

.acd-risk-low {
    background: #f0fdf4;
    color: #16a34a;
}

.acd-risk-description {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.acd-risk-details {
    margin-bottom: 1rem;
}

.acd-risk-details:last-child {
    margin-bottom: 0;
}

.acd-risk-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.acd-risk-list {
    list-style: none;
    margin-left: 0;
    padding: 0;
}

.acd-risk-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
}

.acd-risk-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #94a3b8;
}

/* Hide elements */
.acd-hidden {
    display: none;
}

/* Analysis Modal Overlay for Textarea */
.acd-analysis-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.acd-analysis-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Spinner Container */
.acd-modal-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 20px;
}

/* Animated spinner rings */
.acd-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.acd-spinner-ring:nth-child(1) {
    border-top-color: #2563eb;
    animation-delay: -0.45s;
}

.acd-spinner-ring:nth-child(2) {
    border-right-color: #3b82f6;
    animation-delay: -0.3s;
}

.acd-spinner-ring:nth-child(3) {
    border-bottom-color: #60a5fa;
    animation-delay: -0.15s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Modal Analysis Text */
.acd-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
}

.acd-modal-subtitle {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    max-width: 80%;
    line-height: 1.5;
    min-height: 42px; /* Reserve space for 2 lines */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulsing dot animation for loading */
.acd-modal-subtitle .dots {
    display: inline-block;
}

.acd-modal-subtitle .dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Progress indicator */
.acd-modal-progress {
    width: 200px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 25px; /* Increased to make room for percentage */
    overflow: visible; /* Changed from hidden to visible */
    position: relative;
}

.acd-modal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 2px;
    width: 0%;
    animation: progressPulse 90s ease-out forwards;
    position: relative;
    overflow: hidden; /* Keep the bar contained */
}

/* Progress percentage display */
.acd-modal-progress-percentage {
    position: absolute;
    top: 12px; /* Position below the 4px bar */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
    line-height: 1;
    white-space: nowrap;
}

@keyframes progressPulse {
    0% { width: 0%; }
    15% { width: 12%; }
    30% { width: 23%; }
    45% { width: 34%; }
    60% { width: 45%; }
    75% { width: 56%; }
    85% { width: 67%; }
    95% { width: 78%; }
    100% { width: 85%; }
}