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

@keyframes spin {
  0%   { transform: rotate(0deg); }
  30%  { transform: rotate(90deg); }    /* faster initially */
  60%  { transform: rotate(200deg); }   /* slower middle */
  100% { transform: rotate(360deg); }   /* completes full spin */
}

/* Extracted styles from app/templates/cbs_analysis.html */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #34a853;
    --warning-color: #f9ab00;
    --danger-color: #ea4335;
    --light-bg: #f8f9fa;
    --dark-text: #202124;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark-text);
}

.dashboard-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #eaeaea;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 10px 10px 0 0 !important;
}

.metric-card {
text-align: center;
padding: 1.5rem;
min-height: 160px; /* Add consistent minimum height */
display: flex;
flex-direction: column;
justify-content: center;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.metric-label {
    font-size: 0.9rem;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.positive {
    color: var(--secondary-color);
}

.negative {
    color: var(--danger-color);
}

.neutral {
    color: var(--warning-color);
}

.sentiment-score {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin: 1rem 0;
}

.filter-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.sentiment-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.sentiment-positive {
    background-color: rgba(52, 168, 83, 0.1);
    color: var(--secondary-color);
}

.sentiment-negative {
    background-color: rgba(234, 67, 53, 0.1);
    color: var(--danger-color);
}

.sentiment-neutral {
    background-color: rgba(249, 171, 0, 0.1);
    color: var(--warning-color);
}

.word-cloud-container {
    min-height: 100px;
    position: relative;
    background: linear-gradient(135deg, #fafafa 0%, #fafafa 100%);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.word-cloud-word {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    border-radius: 15px;
    transition: all 0.9s ease;
    cursor: pointer;
    font-weight: 600;
    position: relative;
}

.word-cloud-word:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.word-count {
    font-size: 0.7em;
    opacity: 0.8;
    margin-left: 5px;
}

.readme-content {
    line-height: 1.6;
    font-size: 14px;
}

.readme-content h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.readme-content h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3rem;
}

.readme-content h3 {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.readme-content h4 {
    color: #495057;
    font-size: 1.1rem;
    margin-top: 1rem;
    margin-bottom: 0.6rem;
}

.readme-content p {
    margin-bottom: 0.8rem;
    text-align: justify;
}

.readme-content ul, .readme-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.readme-content li {
    margin-bottom: 0.3rem;
}

.readme-content code {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.readme-content strong {
    color: var(--dark-text);
    font-weight: 600;
}

.topic-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.view-toggle {
    display: flex;
    background-color: white;
    border-radius: 20px;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-toggle button.active {
    background-color: var(--primary-color);
    color: white;
}

.topic-count-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.topic-count-item:last-child {
    border-bottom: none;
}

.topic-name {
    font-weight: 500;
}

.topic-frequency {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.customer-review {
    border-left: 4px solid #eaeaea;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.review-positive {
    border-left-color: var(--secondary-color);
}

.review-negative {
    border-left-color: var(--danger-color);
}

.review-neutral {
    border-left-color: var(--warning-color);
}

.review-text {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.review-meta {
    font-size: 0.85rem;
    color: #5f6368;
}

.progress {
    height: 8px;
    margin-bottom: 0.5rem;
}

.navbar-brand {
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.nav-tabs .nav-link {
    color: #5f6368;
    font-weight: 500;
    border: none;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: transparent;
}

.prediction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.prediction-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.calendar-container {
    display: flex;
    gap: 10px;
}

.calendar-input {
    flex: 1;
}

.ai-insight {
    background-color: rgba(26, 115, 232, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.insight-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.maintenance-alert {
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.alert-high {
    background-color: rgba(234, 67, 53, 0.1);
    border-left: 4px solid var(--danger-color);
}

.alert-medium {
    background-color: rgba(249, 171, 0, 0.1);
    border-left: 4px solid var(--warning-color);
}

.alert-low {
    background-color: rgba(52, 168, 83, 0.1);
    border-left: 4px solid var(--secondary-color);
}

.alert-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

/* Funnel Chart Styles */
.funnel-container {
    padding: 20px 0;
    max-width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.funnel-stage {
    margin-bottom: 15px;
    position: relative;
}

.funnel-bar {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    height: 50px;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    transition: all 0.3s ease;
    margin: 0 auto;
}

.funnel-bar:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
}

.funnel-stage[data-stage="awareness"] .funnel-bar {
    background: linear-gradient(135deg, #1a73e8, #0056b3);
}

.funnel-stage[data-stage="consideration"] .funnel-bar {
    background: linear-gradient(135deg, #34a853, #137333);
}

.funnel-stage[data-stage="purchase"] .funnel-bar {
    background: linear-gradient(135deg, #f9ab00, #e37400);
}

.funnel-stage[data-stage="post-purchase"] .funnel-bar {
    background: linear-gradient(135deg, #9aa0a6, #5f6368);
}

.funnel-stage[data-stage="loyalty"] .funnel-bar {
    background: linear-gradient(135deg, #ea4335, #d33b2c);
}

.funnel-label {
    font-size: 14px;
    font-weight: 500;
}

.funnel-value {
    font-size: 12px;
    opacity: 0.9;
    display: inline;
}

@media (max-width: 768px) {
    .funnel-bar {
        height: 20px;
        padding: 0 15px;
        font-size: 12px;
    }
    
    .funnel-label,
    .funnel-value {
        font-size: 9px;
    }
}

/* Additional inline metric card styles moved from the second style block */
.metric-row { display: flex; gap: 1rem; }
.metric-col { flex: 1 1 0; }
.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 140px; /* fixed height for uniformity; adjust if needed */
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
}
.metric-label { font-size: 0.9rem; color: #6c757d; margin-bottom: 0.25rem; }
.metric-value { font-size: 1.6rem; font-weight: 700; }
.sentiment-score { font-size: 1.6rem; font-weight: 700; }

/* Responsive adjustments */
@media (max-width: 767px) {
    .metric-card { height: auto; padding: 0.75rem; }
    .sentiment-score { font-size: 1.25rem; }
    .metric-value { font-size: 1rem; }
}
