/* Sentence Counter Advanced Styles */

/* Custom animations */
@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Metric cards animations */
.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.metric-value {
    animation: countUp 0.6s ease-out;
}

.analysis-section {
    animation: slideInUp 0.5s ease-out;
}

/* Progress bars */
.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 9999px;
    height: 8px;
    transition: all 0.3s ease;
}

.progress-container {
    background: #e5e7eb;
    border-radius: 9999px;
    height: 8px;
    overflow: hidden;
}

/* Chart styles */
.chart-bar {
    transition: all 0.4s ease;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Readability score indicators */
.readability-excellent {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.readability-good {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.readability-fair {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.readability-poor {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

/* Sentence type visualization */
.sentence-type-card {
    position: relative;
    overflow: hidden;
}

.sentence-type-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-color, #3b82f6);
}

/* Text analysis highlights */
.text-highlight {
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.highlight-declarative {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
}

.highlight-interrogative {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
}

.highlight-imperative {
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
}

.highlight-exclamatory {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Keyword density visualization */
.keyword-bar {
    height: 20px;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.keyword-item:hover .keyword-bar {
    transform: scaleX(1.05);
}

/* Export modal styles */
.export-modal {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.5);
}

.export-modal-content {
    max-height: 80vh;
    overflow-y: auto;
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }

    .chart-container {
        overflow-x: auto;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Accessibility improvements */
.metric-card:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .metric-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Custom scrollbar for analysis panels */
.analysis-panel::-webkit-scrollbar {
    width: 8px;
}

.analysis-panel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.analysis-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.analysis-panel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}
