/* Global Design System CSS */
/* Based on agreed design system from documentation/DESIGN_SYSTEM.md */

/* ================================
   GLOBAL DESIGN TOKENS (CSS VARIABLES)
   ================================ */

:root {
    /* Border Radius System */
    --border-radius-standard: 6px;
    --border-radius-large: 8px;
    --border-radius-small: 4px;
    --border-radius-round: 50%;
    
    /* Shadow System */
    --shadow-standard: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1);
    
    /* Color System */
    --color-primary-purple: #6f42c1;
    --color-primary-purple-hover: #5a36a3;
    --color-primary-purple-light: rgba(111, 66, 193, 0.1);
    --color-purple-primary: #8b5cf6;
    --color-purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    --color-background-primary: #f5f5f5;
    --color-background-card: #ffffff;
    --color-background-header: #6f42c1;
    
    --color-text-primary: #1f2937;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    
    --color-border-light: #e0e0e0;
    --color-border-standard: #d1d5db;
    
    /* Sentiment Color System */
    --color-sentiment-very-positive: #10b981;
    --color-sentiment-positive: #34d399;
    --color-sentiment-neutral: #f59e0b;
    --color-sentiment-negative: #f87171;
    --color-sentiment-very-negative: #ef4444;
    
    /* Spacing System */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography System */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-heavy: 800;
    
    /* Metric System */
    --metric-icon-size: 2rem;
    --metric-value-size: 2.5rem;
    --metric-subtitle-size: 0.875rem;
    --metric-container-height: 120px;
    --metric-container-padding: 1.5rem;
}

/* ================================
   GLOBAL BACKGROUND SYSTEM
   ================================ */

/* Light gray background for all pages */
body {
    background-color: var(--color-background-primary);
    margin: 0;
    padding: 0;
    color: var(--color-text-primary);
}

.page-background {
    background-color: var(--color-background-primary);
    min-height: auto;
}

/* ================================
   GLOBAL METRIC SYSTEM
   ================================ */

/* Metric containers - reusable across all pages */
.metric-container {
    min-height: var(--metric-container-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--metric-container-padding);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.02) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: var(--border-radius-standard);
    position: relative;
    overflow: visible;
    flex-direction: column;
    text-align: center;
}

.metric-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-container:hover::before {
    opacity: 1;
}

.metric-icon {
    font-size: var(--metric-icon-size);
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
    line-height: 1.2;
    display: block;
}

.metric-value {
    font-size: var(--metric-value-size);
    font-weight: var(--font-weight-heavy);
    color: var(--color-text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
}

.metric-subtitle {
    font-size: var(--metric-subtitle-size);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-muted);
    margin-top: var(--spacing-sm);
    opacity: 0.8;
    line-height: 1.2;
    display: block;
    clear: both;
    text-align: center;
    width: 100%;
}

/* Empty state styling */
.empty-chart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: var(--metric-container-height);
    text-align: center;
    padding: var(--metric-container-padding);
}

.empty-icon {
    font-size: var(--metric-icon-size);
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
}

.empty-title {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* Sentiment color utilities */
.sentiment-very-positive { color: var(--color-sentiment-very-positive); }
.sentiment-positive { color: var(--color-sentiment-positive); }
.sentiment-neutral { color: var(--color-sentiment-neutral); }
.sentiment-negative { color: var(--color-sentiment-negative); }
.sentiment-very-negative { color: var(--color-sentiment-very-negative); }

/* ================================
   GLOBAL NAVIGATION SYSTEM
   ================================ */

/* Navigation styling */
.main-nav {
    background: var(--color-background-card) !important;
    border-color: var(--color-border-light) !important;
    color: var(--color-text-primary) !important;
    border-bottom: 1px solid var(--color-border-light) !important;
    border-radius: 0 !important;
}

/* ================================
   GLOBAL CARD SYSTEM
   ================================ */

/* Standard white card with subtle border and minimal shadow */
.card-global {
    background: var(--color-background-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-standard);
    box-shadow: var(--shadow-standard);
    margin-bottom: var(--spacing-md);
}

/* Card with hover effect (2px lift) */
.card-global.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-global.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ================================
   GLOBAL HEADER SYSTEM
   ================================ */

/* Purple header pattern */
.header-purple {
    background: var(--color-background-header);
    color: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-standard) var(--border-radius-standard) 0 0;
    margin-bottom: 0;
}

.header-purple h1,
.header-purple h2,
.header-purple h3 {
    color: white;
    margin: 0;
}

/* ================================
   GLOBAL BUTTON SYSTEM
   ================================ */

/* Primary purple button */
.btn-purple {
    background: var(--color-primary-purple);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-standard);
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-purple:hover {
    background: var(--color-primary-purple-hover);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Right-aligned button in flex container */
.btn-right-align {
    margin-left: auto;
}

/* ================================
   GLOBAL AVATAR SYSTEM
   ================================ */

/* Standard 50px avatar */
.avatar-standard {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-round);
    object-fit: cover;
}

/* ================================
   GLOBAL BADGE SYSTEM
   ================================ */

/* Compact badge design */
.badge-compact {
    font-size: 0.75rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-small);
    font-weight: var(--font-weight-medium);
}

/* ================================
   GLOBAL TYPOGRAPHY SYSTEM
   ================================ */

/* Clean typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.text-compact {
    font-size: 0.9rem;
    line-height: 1.4;
}

.text-muted {
    color: var(--color-text-muted);
}

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

/* ================================
   GLOBAL SPACING SYSTEM
   ================================ */

/* Compact spacing patterns */
.spacing-compact {
    padding: var(--spacing-xl);
}

.spacing-small {
    padding: var(--spacing-md);
}

.spacing-minimal {
    padding: var(--spacing-sm);
}

/* ================================
   GLOBAL EMPTY STATE SYSTEM
   ================================ */

/* White info banner */
.info-banner {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #666666;
    margin: 1rem 0;
}

/* Empty state container */
.empty-state {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 40px 20px;
    border-radius: 8px;
    text-align: center;
    color: #666666;
    margin: 1rem 0;
}

/* Chart empty state - for when charts have no data */
.empty-chart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-align: center;
    padding: 2rem;
}

.empty-chart-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-chart-state .empty-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.empty-chart-state .empty-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ================================
   GLOBAL RESPONSIVE SYSTEM
   ================================ */

/* Mobile adjustments */
@media (max-width: 768px) {
    .avatar-standard {
        width: 40px;
        height: 40px;
    }
    
    .header-purple {
        padding: 15px;
    }
    
    .spacing-compact {
        padding: 15px;
    }
    
    .btn-purple {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ================================
   GLOBAL FLEX UTILITIES
   ================================ */

/* Flex container for header with right-aligned button */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ================================
   GLOBAL BORDER UTILITIES
   ================================ */

.border-light {
    border: 1px solid var(--color-border-light);
}

.border-standard {
    border: 1px solid var(--color-border-standard);
}

.rounded-standard {
    border-radius: var(--border-radius-standard);
}

.rounded-small {
    border-radius: var(--border-radius-small);
}

.rounded-large {
    border-radius: var(--border-radius-large);
}