/* Minimalist, Jony Ive-inspired design with Circular Std Bold */
@import url('https://fonts.cdnfonts.com/css/circular-std');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --accent: #0071e3;
    --border: #d2d2d7;
    --success: #30d158;
    --warning: #ff9f0a;
    --error: #ff3b30;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
}

body {
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Avenir Next', 'Avenir', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    background: var(--secondary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
}

.title {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    font-family: 'Circular Std', sans-serif;
}

.subtitle {
    font-size: 21px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    margin-bottom: 12px;
}

.tagline {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
}

.clarm-link,
.sales-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.clarm-link:hover,
.sales-link:hover {
    border-bottom: 2px solid var(--accent);
    color: #0077ed;
}

.sales-link {
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #0077ed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Input Section */
.input-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 48px;
    margin-bottom: 40px;
    box-shadow: 0 4px 24px var(--shadow);
}

.input-wrapper {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.repo-input,
.token-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 17px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.3s ease;
    background: var(--primary-bg);
    font-family: 'Circular Std', sans-serif;
    font-weight: 700;
}

.repo-input:focus,
.token-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* Example Repos */
.example-repos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.example-label {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    margin-right: 8px;
}

.example-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    min-width: 200px;
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.05) 0%, rgba(0, 113, 227, 0.1) 100%);
    border: 1.5px solid rgba(0, 113, 227, 0.2);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.example-btn:hover {
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.1) 0%, rgba(0, 113, 227, 0.15) 100%);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

.example-btn:active {
    transform: translateY(0);
}

.example-icon {
    font-size: 16px;
}

.example-name {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 600;
}

.input-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 700;
}

/* Mobile responsive for examples */
@media (max-width: 600px) {
    .input-section {
        padding: 32px 24px;
    }
    
    .example-repos {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }
    
    .example-btn {
        width: 100%;
        justify-content: center;
    }
}

.analyze-btn {
    padding: 16px 40px;
    font-size: 17px;
    font-weight: 700;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Circular Std', sans-serif;
}

.analyze-btn:hover {
    background: #0077ed;
    transform: scale(1.02);
}

.analyze-btn:active {
    transform: scale(0.98);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 17px;
    font-family: 'Circular Std', sans-serif;
    font-weight: 700;
}

/* Error State */
.error {
    background: #fff;
    border: 2px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
    color: var(--error);
    font-size: 15px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 24px var(--shadow);
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    font-family: 'Circular Std', sans-serif;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric {
    text-align: center;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
}

.metric-value {
    display: block;
    font-size: 36px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.metric-label {
    display: block;
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
}

/* Repository Info */
.repo-info {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.repo-description {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.metric-card {
    padding: 24px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    text-align: center;
}

.metric-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.metric-large {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent);
}

.metric-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Opportunity List */
.opportunity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.opportunity-item {
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}

.opportunity-item h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.opportunity-item p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.opportunity-priority {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-high {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error);
}

.priority-medium {
    background: rgba(255, 159, 10, 0.1);
    color: var(--warning);
}

.priority-low {
    background: rgba(48, 209, 88, 0.1);
    color: var(--success);
}

/* Presence Grid */
.presence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.presence-item {
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    text-align: center;
}

.presence-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.presence-status {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-present {
    background: var(--success);
}

.status-missing {
    background: var(--error);
}

.status-partial {
    background: var(--warning);
}

/* Contributors List */
.contributors-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.contributor-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease;
}

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

.contributor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 16px;
}

.contributor-info {
    flex: 1;
}

.contributor-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.contributor-stats {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.activity-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Recommendations */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recommendation-item {
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary-bg) 0%, #e8e8ed 100%);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}

.recommendation-item h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recommendation-icon {
    font-size: 20px;
}

.recommendation-item p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.recommendation-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-tag {
    padding: 6px 14px;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

/* Quick Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, var(--accent) 0%, #0077ed 100%);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px rgba(0, 113, 227, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
}

.stat-icon {
    font-size: 36px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.stat-label {
    font-size: 15px;
    opacity: 1;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    text-shadow: none;
    letter-spacing: 0.5px;
}

/* Growth Goals */
.growth-goals {
    display: grid;
    gap: 16px;
}

.goal-item {
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.goal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.goal-target {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.goal-progress {
    height: 8px;
    background: #e5e5ea;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.goal-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #0077ed);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.goal-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.action-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 113, 227, 0.15);
}

.action-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.action-icon {
    font-size: 48px;
    line-height: 1;
}

.action-title {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
    font-family: 'Circular Std', sans-serif;
}

.action-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.action-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Action Items */
.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.action-item:hover {
    background: #e8e8ed;
    transform: translateX(4px);
}

.action-item-content {
    flex: 1;
}

.action-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.action-item-description {
    font-size: 13px;
    color: var(--text-secondary);
}

.action-item-impact {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(48, 209, 88, 0.1);
    color: var(--success);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-action,
.btn-action-secondary {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: 'Circular Std', sans-serif;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #0077ed;
    transform: scale(1.05);
}

.btn-secondary {
    background: white;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
}

.btn-action {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.btn-action:hover {
    background: var(--accent);
    color: white;
}

.btn-action:active {
    transform: scale(0.95);
}

/* Secondary button variant */
.btn-action-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--secondary-bg);
}

.btn-action-secondary:hover {
    background: var(--secondary-bg);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-action-secondary:active {
    transform: scale(0.95);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.template-card {
    padding: 24px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.1);
}

.template-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.template-type {
    font-size: 28px;
}

.template-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Circular Std', sans-serif;
}

.template-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.template-preview {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

.template-actions {
    display: flex;
    gap: 8px;
}

/* Action Timeline */
.action-timeline {
    position: relative;
    padding-left: 40px;
}

.action-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, #e5e5ea 100%);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

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

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-week {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.timeline-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.timeline-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.timeline-task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-task-checkbox:hover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.1);
}

.timeline-task-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
}

.timeline-task-time {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Copy Indicator */
.copy-success {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(48, 209, 88, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1000;
    font-family: 'Circular Std', sans-serif;
}

/* Star Velocity Visualization */
.star-velocity-container {
    padding: 20px 0;
}

.velocity-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.velocity-stat {
    text-align: center;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
}

.velocity-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.velocity-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 700;
}

.velocity-stat-with-dropdown {
    position: relative;
}

.velocity-label-with-dropdown {
    margin-top: 8px;
}

.metric-selector {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    color: var(--text-primary);
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.metric-selector:hover {
    border-color: var(--accent);
}

.metric-selector:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.velocity-chart {
    height: 200px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    position: relative;
}

/* Dynamic Chart Styles */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Circular Std', sans-serif;
}

.time-selector {
    display: flex;
    gap: 8px;
    background: var(--secondary-bg);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.time-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.time-btn:hover {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent);
}

.time-btn.active {
    background: var(--accent);
    color: white;
}

.dynamic-chart {
    margin-top: 20px;
    min-height: 300px;
}

.chart-wrapper {
    width: 100%;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
}

.chart-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 250px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    height: 100%;
}

.chart-bars-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.chart-bar {
    position: relative;
    width: 16px;
    min-height: 4px;
    transition: all 0.3s ease;
}

.chart-bar:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    border-radius: 4px 4px 0 0;
}

.bar-fill-stars {
    background: linear-gradient(to top, #0071E3, #00A2FF);
}

.bar-fill-commits {
    background: linear-gradient(to top, #30D158, #5AFF8A);
}

.bar-fill-activity {
    background: linear-gradient(to top, #FF9500, #FFB340);
}

.chart-bar-label {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    font-family: 'Circular Std', sans-serif;
}

/* Responsive chart */
@media (max-width: 768px) {
    .chart-bars {
        padding: 12px;
        gap: 4px;
        height: 200px;
    }
    
    .chart-bar-group {
        min-width: 40px;
    }
    
    .chart-bar {
        width: 12px;
    }
    
    .chart-bar-label {
        font-size: 9px;
        transform: rotate(-45deg);
        transform-origin: center;
        margin-top: 16px;
    }
    
    .time-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .time-btn {
        flex: 1;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Stargazer Analysis */
.stargazer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.stargazer-segment {
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
}

.segment-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 12px;
}

.segment-count {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.segment-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Remove special Clarm styling - blend into regular sections */

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: 92vh; /* allow inner scrolling when content is tall */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Draft Modal Enhancements */
.modal-draft {
    max-width: 760px;
    width: min(94vw, 760px);
    max-height: 92vh; /* ensure draft modal scrolls independently */
    overflow-y: auto;
}

.draft-status {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--secondary-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text-secondary);
    font-weight: 600;
}

.draft-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

.draft-editor {
    margin-top: 14px;
}

.draft-textarea {
    width: 100%;
    height: 220px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background: #fff;
    color: var(--text-primary);
}

.draft-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.draft-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
    margin: 8px 2px 0 2px;
}

.draft-hint {
    font-style: italic;
}

.draft-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.draft-image {
    margin-top: 12px;
}

.draft-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

/* Small utility in modal body */
.stat-card { background: var(--secondary-bg); padding: 12px; border-radius: 10px; text-align: center; }
.stat-kpi { font-size: 24px; font-weight: 800; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 12px; }
.badge { background: #eef2ff; color: #3730a3; font-weight: 700; padding: 6px 10px; border-radius: 999px; font-size: 12px; }

/* Growth modal tabs */
.tab-nav { display:flex; gap:6px; margin: 6px 0 12px 0; flex-wrap: wrap; }
.tab-pill { border:1px solid var(--border); background:#fff; color:var(--text-primary); border-radius:999px; padding:8px 12px; cursor:pointer; font-weight:700; font-size:13px; }
.tab-pill.active { background: var(--accent); color:#fff; border-color: var(--accent); }

.growth-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:12px; }
.sparkline { margin-top: 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.sparkline canvas { width: 100%; height: 60px; display:block; }

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--secondary-bg);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Circular Std', sans-serif;
}

.modal-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-form input[type="email"] {
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-family: 'Circular Std', sans-serif;
    font-weight: 700;
    outline: none;
    transition: all 0.3s ease;
}

.lead-form input[type="email"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.modal-footer {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.modal-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Educational Tooltips */
.edu-tooltip {
    position: fixed;
    max-width: 400px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 24px;
    z-index: 3000;
    animation: tooltipSlideIn 0.3s ease;
}

@keyframes tooltipSlideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.edu-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.edu-tooltip-icon {
    font-size: 28px;
}

.edu-tooltip-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
    font-family: 'Circular Std', sans-serif;
}

.edu-tooltip-close {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--secondary-bg);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
}

.edu-tooltip-close:hover {
    background: var(--accent);
    color: white;
}

.edu-tooltip-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.edu-tooltip-example {
    background: #FFF9E6;
    border-left: 3px solid #FFD700;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.edu-tooltip-example strong {
    display: block;
    margin-bottom: 6px;
    color: #1d1d1f;
    font-family: 'Circular Std', sans-serif;
}

.edu-tooltip-example-text {
    color: #424245;
}

.edu-tooltip-learn-more {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Achievement Toasts (Duolingo-style) */
.achievement-toast {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 20px 32px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 4000;
    transition: top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.achievement-toast.show {
    top: 24px;
}

.achievement-icon {
    font-size: 48px;
}

.achievement-content {
    text-align: left;
}

.achievement-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    font-family: 'Circular Std', sans-serif;
}

.achievement-description {
    font-size: 15px;
    opacity: 0.95;
}

/* Info Icons (clickable learn more) */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--secondary-bg);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    transition: all 0.2s ease;
    margin-left: 6px;
    color: var(--accent);
}

.info-icon:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* Share Card Preview */
.share-card-container {
    margin-top: 32px;
    padding: 32px;
    background: var(--secondary-bg);
    border-radius: var(--radius);
    text-align: center;
}

.share-card-preview {
    max-width: 600px;
    margin: 0 auto 24px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.share-card-preview canvas {
    width: 100%;
    height: auto;
    display: block;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-share-twitter {
    background: #1DA1F2;
    color: white;
}

.btn-share-twitter:hover {
    background: #1a8cd8;
    transform: translateY(-2px);
}

.btn-share-linkedin {
    background: #0A66C2;
    color: white;
}

.btn-share-linkedin:hover {
    background: #004182;
    transform: translateY(-2px);
}

.btn-share-download {
    background: var(--accent);
    color: white;
}

.btn-share-download:hover {
    background: #0051a8;
    transform: translateY(-2px);
}

/* Data Freshness Indicator */
.data-freshness {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.last-updated {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Circular Std', sans-serif;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.refresh-btn:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 113, 227, 0.05), rgba(0, 113, 227, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.refresh-btn:active .refresh-icon {
    animation: spin 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .data-freshness {
        flex-direction: column;
        text-align: center;
    }
    
    .refresh-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Score Display (Gamification) */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #0051a8 100%);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 17px;
    font-family: 'Circular Std', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.score-number {
    font-size: 24px;
}

.level-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    margin-left: 12px;
    font-family: 'Circular Std', sans-serif;
}

.level-elite { background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%); color: #1d1d1f; }
.level-advanced { background: linear-gradient(135deg, #0071E3 0%, #0051a8 100%); color: white; }
.level-growing { background: linear-gradient(135deg, #30D158 0%, #248A3D 100%); color: white; }
.level-emerging { background: linear-gradient(135deg, #FF9500 0%, #C76A00 100%); color: white; }
.level-starting { background: linear-gradient(135deg, #86868b 0%, #6e6e73 100%); color: white; }

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

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: 'Circular Std', sans-serif;
    font-weight: 700;
}

.footer p {
    margin-bottom: 12px;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #0077ed;
    text-decoration: underline;
}

.footer-links {
    margin: 16px 0;
    font-size: 13px;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-note {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 16px auto 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 36px;
    }

    .subtitle {
        font-size: 17px;
    }

    .card-title {
        font-size: 24px;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .analyze-btn {
        width: 100%;
    }

    .stats-bar {
        flex-direction: column;
        gap: 16px;
    }

    .stat-item {
        justify-content: center;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
    }

    .btn-secondary {
        width: 100%;
    }

    .action-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-action {
        width: 100%;
    }
    
    .btn-action-secondary {
        width: 100%;
    }

    .action-timeline {
        padding-left: 20px;
    }
    
    /* Draft content two-column grid becomes single column on mobile */
    #draftContent > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .action-timeline::before {
        left: 10px;
    }

    .timeline-dot {
        left: -18px;
    }
}

/* Token Input Styles */
.token-input-wrapper {
    max-width: 600px;
    margin: 12px auto 0;
}

.token-details {
    background: rgba(0, 113, 227, 0.03);
    border: 1.5px solid rgba(0, 113, 227, 0.15);
    border-radius: var(--radius-sm);
    padding: 16px 24px;
}

.token-summary {
    font-size: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.token-summary::-webkit-details-marker {
    display: none;
}

.token-content {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.token-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.save-token-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-token-btn:hover {
    background: #0077ed;
    transform: scale(1.02);
}

.token-note {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-note a {
    color: var(--accent);
    text-decoration: none;
}

.token-note a:hover {
    text-decoration: underline;
}

/* System Status Collapsible */
.system-status-details {
    max-width: 800px;
    margin: 16px auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.system-status-summary {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.system-status-summary::-webkit-details-marker {
    display: none;
}

.system-status-summary:hover {
    color: var(--text-primary);
    background: var(--secondary-bg);
}

.system-status-content {
    padding: 0 20px 20px;
}

/* API Status Styles */
.api-status {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 16px 0;
    padding: 12px 24px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-weight: 700;
    color: var(--text-primary);
}

.status-value.status-ok {
    color: var(--success);
}

.status-value.status-warning {
    color: var(--warning);
}

.status-value.status-error {
    color: var(--error);
}


/* Cache Dashboard */
.cache-dashboard {
    max-width: 800px;
    margin: 24px auto;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px var(--shadow);
}

.dashboard-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-primary);
}

.token-config-section {
    max-width: 800px;
    margin: 24px auto;
    padding: 24px;
    background: rgba(0, 113, 227, 0.03);
    border: 1.5px solid rgba(0, 113, 227, 0.15);
    border-radius: var(--radius);
}

.token-config-section .token-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cache-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.cache-repo-card {
    padding: 16px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.cache-repo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cache-repo-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.cache-repo-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.cache-repo-status.complete {
    background: var(--success);
    color: white;
}

.cache-repo-status.partial {
    background: var(--warning);
    color: white;
}

.cache-repo-status.empty {
    background: var(--text-secondary);
    color: white;
}

.cache-metrics {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cache-metric {
    flex: 1;
    min-width: 150px;
}

.cache-metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.cache-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.cache-metric-value .percentage {
    font-size: 14px;
    color: var(--success);
    margin-left: 6px;
}

.cache-progress-bar {
    margin-top: 12px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.cache-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%);
    transition: width 0.3s ease;
}

.refresh-cache-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-cache-btn:hover {
    background: #0077ed;
    transform: translateY(-1px);
}

.cache-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.cache-empty-state p {
    margin-top: 12px;
    font-size: 14px;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    margin: 24px 0;
    padding: 0;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.tab-navigation::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
    flex: 1; /* Equal width tabs */
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: -2px;
    text-align: center; /* Center text within each tab */
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--secondary-bg);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tab Content */
.tab-content-wrapper {
    position: relative;
    min-height: 400px;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    will-change: opacity, transform;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

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

.tab-header {
    text-align: center;
    margin-bottom: 40px;
}

.tab-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tab-header p {
    font-size: 16px;
    color: var(--text-secondary);
}

.loading-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Intelligence Cards */
.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.intelligence-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.intelligence-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.intelligence-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.intelligence-card-badge {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--secondary-bg);
    color: var(--text-secondary);
    font-weight: 700;
}

/* Company Intelligence */
.company-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.company-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.company-item:hover {
    background: var(--secondary-bg);
    border-color: var(--border);
}

.company-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.company-item-header:hover .expand-icon {
    color: var(--accent);
    transform: scale(1.1);
}

.expand-icon {
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-left: auto;
}

.expand-icon.expanded {
    transform: rotate(180deg);
}

.company-users-dropdown {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

.company-users-dropdown.visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-card-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.user-card-mini:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.user-info-mini {
    flex: 1;
    min-width: 0;
}

.user-name-mini {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-username-mini {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-contact-mini {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.contact-btn-mini {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--primary-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.contact-btn-mini:hover {
    background: var(--accent);
    color: var(--primary-bg);
    border-color: var(--accent);
}

.company-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 30px;
}

.company-info {
    flex: 1;
    min-width: 0;
}

.company-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.company-bar-container {
    height: 6px;
    background: var(--secondary-bg);
    border-radius: 3px;
    overflow: hidden;
}

.company-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.company-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* Geographic Distribution */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.location-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
}

.location-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-bar-container {
    height: 4px;
    background: var(--card-bg);
    border-radius: 2px;
    overflow: hidden;
}

.location-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.location-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Top Influencers */
.influencer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.influencer-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.influencer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--accent);
}

.influencer-card a {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.influencer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.influencer-info {
    flex: 1;
    min-width: 0;
}

.influencer-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.influencer-username {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.influencer-company {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.influencer-stats {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
}

.btn-contact {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: var(--primary-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-contact:hover {
    background: var(--accent);
    color: var(--primary-bg);
    border-color: var(--accent);
}

/* Developer Personas */
.persona-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.persona-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.persona-item:hover {
    background: var(--secondary-bg);
    border-color: var(--border);
}

.persona-item-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.persona-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.persona-emoji {
    font-size: 20px;
}

.persona-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.persona-bar-container {
    flex: 1;
    height: 24px;
    background: var(--secondary-bg);
    border-radius: 12px;
    overflow: hidden;
}

.persona-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.4s ease;
}

.persona-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    justify-content: flex-end;
}

.persona-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.persona-percentage {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Growth Analysis Styles */
.viral-score-display {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.viral-score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.viral-score-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.viral-score-label {
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.viral-factors {
    margin-top: 32px;
}

.factor-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.factor-label {
    min-width: 150px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.factor-bar-container {
    flex: 1;
    height: 20px;
    background: var(--secondary-bg);
    border-radius: 10px;
    overflow: hidden;
}

.factor-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.factor-value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

.trend-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.trend-metric-card {
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius);
    text-align: center;
}

.trend-metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.trend-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.trend-metric-suffix {
    font-size: 13px;
    color: var(--text-secondary);
}

.competitive-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.competitive-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius);
}

.competitive-icon {
    font-size: 32px;
}

.competitive-content {
    flex: 1;
}

.competitive-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.competitive-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.forecast-card {
    padding: 24px;
    background: var(--secondary-bg);
    border-radius: var(--radius);
    text-align: center;
}

.forecast-period {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.forecast-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.forecast-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Action Items Styles */
.export-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.export-btn span {
    margin-right: 8px;
}

.leads-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.leads-table-header {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1fr 120px;
    gap: 16px;
    padding: 12px 16px;
    background: var(--secondary-bg);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.lead-row {
    display: grid;
    grid-template-columns: 80px 2fr 1.5fr 1fr 120px;
    gap: 16px;
    padding: 16px;
    border-top: 1px solid var(--border);
    align-items: center;
    transition: background 0.2s;
}

.lead-row:hover {
    background: var(--secondary-bg);
}

.lead-col-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lead-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lead-name-info {
    min-width: 0;
}

.lead-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-name:hover {
    color: var(--accent);
}

.lead-username {
    font-size: 12px;
    color: var(--text-secondary);
}

.lead-col-company, .lead-col-reach {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-col-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.contact-link {
    font-size: 12px;
    text-decoration: none;
    color: var(--accent);
    white-space: nowrap;
}

.contact-link:hover {
    text-decoration: underline;
}

.action-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: var(--radius);
}

.action-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.action-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.action-priority {
    padding: 6px 12px;
    border: 2px solid;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.company-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Lead Scoring & Segmentation */
.lead-col-score {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lead-score-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.lead-col-segment {
    display: flex;
    align-items: center;
}

.segment-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
}

/* Email Templates */
.template-details {
    margin-bottom: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.template-summary {
    padding: 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background 0.2s;
}

.template-summary::-webkit-details-marker {
    display: none;
}

.template-summary:hover {
    background: var(--secondary-bg);
}

.template-content {
    padding: 0 20px 20px;
}

.template-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.template-body {
    padding: 16px;
    background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.prompt-presets {
    margin-bottom: 12px;
}

.preset-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.preset-toggle-group button {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.preset-toggle-group button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 1px 6px rgba(0, 113, 227, 0.35);
}

.preset-toggle-group button:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

.prompt-regen-btn {
    width: 100%;
    margin-top: 16px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
}

.prompt-regen-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Print styles */
@media print {
    .input-section,
    .footer,
    .tab-navigation {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border);
        page-break-inside: avoid;
    }

    .tab-content {
        display: block !important;
    }
}


/* Draft modal scroll fallback (ensure scrolling in production) */
.modal-content,
.modal-draft {
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
