/* ============================================
   SPOTLY - Design System v2.0
   Clean, Professional Workspace Management
   ============================================ */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* ========== LIGHT THEME ========== */
    /* Main Colors */
    --spotly-main: #ECF0F1;
    --spotly-secondary: #BDC3C7;
    --spotly-text: #2C3E50;
    --spotly-error: #E74C3C;
    --spotly-success: #27AE60;
    --spotly-warning: #F39C12;
    --spotly-info: #3498DB;
    
    /* Extended Palette */
    --spotly-main-dark: #D5DBDB;
    --spotly-main-light: #F4F6F6;
    --spotly-secondary-dark: #95A5A6;
    --spotly-secondary-light: #D0D3D4;
    --spotly-text-light: #5D6D7E;
    --spotly-text-muted: #7F8C8D;
    
    /* Accent Colors */
    --spotly-accent-1: #3498DB; /* Blue */
    --spotly-accent-2: #9B59B6; /* Purple */
    --spotly-accent-3: #1ABC9C; /* Teal */
    --spotly-accent-4: #E67E22; /* Orange */
    
    /* Surfaces */
    --spotly-surface: #FFFFFF;
    --spotly-surface-elevated: #FFFFFF;
    --spotly-surface-hover: #F8F9FA;
    --spotly-border: #E5E8E8;
    --spotly-border-light: #F2F3F4;
    
    /* Shadows */
    --spotly-shadow-sm: 0 1px 2px rgba(44, 62, 80, 0.05);
    --spotly-shadow: 0 4px 12px rgba(44, 62, 80, 0.08);
    --spotly-shadow-lg: 0 8px 32px rgba(44, 62, 80, 0.12);
    --spotly-shadow-xl: 0 16px 48px rgba(44, 62, 80, 0.16);
    
    /* Transitions */
    --spotly-transition-fast: 0.15s ease;
    --spotly-transition: 0.25s ease;
    --spotly-transition-slow: 0.4s ease;
    
    /* Border Radius */
    --spotly-radius-sm: 8px;
    --spotly-radius: 12px;
    --spotly-radius-lg: 16px;
    --spotly-radius-xl: 24px;
    --spotly-radius-2xl: 32px;
    
    /* Spacing */
    --spotly-space-xs: 4px;
    --spotly-space-sm: 8px;
    --spotly-space-md: 16px;
    --spotly-space-lg: 24px;
    --spotly-space-xl: 32px;
    --spotly-space-2xl: 48px;
    
    /* Font Family */
    --spotly-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --spotly-main: #2C3E50;
    --spotly-secondary: #34495E;
    --spotly-text: #ECF0F1;
    --spotly-main-dark: #1A252F;
    --spotly-main-light: #3D566E;
    --spotly-secondary-dark: #2C3E50;
    --spotly-secondary-light: #415B76;
    --spotly-text-light: #BDC3C7;
    --spotly-text-muted: #95A5A6;
    --spotly-surface: #2C3E50;
    --spotly-surface-elevated: #34495E;
    --spotly-surface-hover: #3D566E;
    --spotly-border: #415B76;
    --spotly-border-light: #34495E;
    --spotly-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --spotly-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --spotly-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ========== BASE STYLES ========== */
html, body {
    font-family: var(--spotly-font);
    background-color: var(--spotly-main);
    color: var(--spotly-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== ANIMATIONS ========== */
@keyframes spotly-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes spotly-slideLeft {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes spotly-scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes spotly-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spotly-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spotly-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes spotly-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animation Classes */
.spotly-fade-in { animation: spotly-fadeIn var(--spotly-transition) ease-out forwards; }
.spotly-slide-up { animation: spotly-slideUp var(--spotly-transition) ease-out forwards; }
.spotly-slide-down { animation: spotly-slideDown var(--spotly-transition) ease-out forwards; }
.spotly-slide-left { animation: spotly-slideLeft var(--spotly-transition) ease-out forwards; }
.spotly-scale-in { animation: spotly-scaleIn var(--spotly-transition) ease-out forwards; }
.spotly-float { animation: spotly-float 3s ease-in-out infinite; }
.spotly-pulse { animation: spotly-pulse 2s ease-in-out infinite; }
.spotly-spin { animation: spotly-spin 1s linear infinite; }

/* Staggered Animation Delays */
.spotly-delay-1 { animation-delay: 0.1s; }
.spotly-delay-2 { animation-delay: 0.2s; }
.spotly-delay-3 { animation-delay: 0.3s; }
.spotly-delay-4 { animation-delay: 0.4s; }
.spotly-delay-5 { animation-delay: 0.5s; }

/* ========== SPLASH SCREEN ========== */
.spotly-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--spotly-main) 0%, var(--spotly-secondary) 100%);
    z-index: 9999;
}

.spotly-splash-logo {
    width: 120px;
    height: 120px;
    background: var(--spotly-text);
    border-radius: var(--spotly-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spotly-space-lg);
    animation: spotly-float 2s ease-in-out infinite;
    box-shadow: var(--spotly-shadow-xl);
}

.spotly-splash-logo svg {
    width: 60%;
    height: 60%;
    fill: var(--spotly-main);
}

.spotly-splash-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--spotly-text);
    letter-spacing: -0.02em;
    margin-bottom: var(--spotly-space-sm);
}

.spotly-splash-subtitle {
    font-size: 1rem;
    color: var(--spotly-text-muted);
    margin-bottom: var(--spotly-space-xl);
}

.spotly-splash-loader {
    width: 200px;
    height: 4px;
    background: var(--spotly-border);
    border-radius: 2px;
    overflow: hidden;
}

.spotly-splash-loader-bar {
    height: 100%;
    background: var(--spotly-text);
    border-radius: 2px;
    animation: spotly-shimmer 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, var(--spotly-text) 0%, var(--spotly-secondary) 50%, var(--spotly-text) 100%);
    background-size: 200% 100%;
}

/* ========== SIDEBAR ========== */
.spotly-sidebar {
    width: 280px;
    height: 100vh;
    background: var(--spotly-surface);
    border-right: 1px solid var(--spotly-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform var(--spotly-transition);
}

.spotly-sidebar.collapsed {
    transform: translateX(-100%);
}

.spotly-sidebar-header {
    padding: var(--spotly-space-lg);
    border-bottom: 1px solid var(--spotly-border);
}

.spotly-sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--spotly-space-md);
}

.spotly-sidebar-logo {
    width: 44px;
    height: 44px;
    background: var(--spotly-text);
    border-radius: var(--spotly-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotly-sidebar-logo svg {
    width: 24px;
    height: 24px;
    fill: var(--spotly-surface);
}

.spotly-sidebar-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--spotly-text);
    letter-spacing: -0.02em;
}

.spotly-sidebar-nav {
    flex: 1;
    padding: var(--spotly-space-md);
    overflow-y: auto;
}

.spotly-nav-item {
    display: flex;
    align-items: center;
    gap: var(--spotly-space-md);
    padding: var(--spotly-space-md) var(--spotly-space-lg);
    border-radius: var(--spotly-radius);
    color: var(--spotly-text-light);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--spotly-transition-fast);
    margin-bottom: var(--spotly-space-xs);
}

.spotly-nav-item:hover {
    background: var(--spotly-surface-hover);
    color: var(--spotly-text);
}

.spotly-nav-item.active {
    background: var(--spotly-text);
    color: var(--spotly-surface);
}

.spotly-nav-item.active:hover {
    background: var(--spotly-text);
}

.spotly-nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.spotly-sidebar-footer {
    padding: var(--spotly-space-lg);
    border-top: 1px solid var(--spotly-border);
}

/* ========== CARDS ========== */
.spotly-card {
    background: var(--spotly-surface);
    border-radius: var(--spotly-radius-lg);
    box-shadow: var(--spotly-shadow);
    padding: var(--spotly-space-lg);
    transition: all var(--spotly-transition);
}

.spotly-card:hover {
    box-shadow: var(--spotly-shadow-lg);
}

.spotly-card-elevated {
    box-shadow: var(--spotly-shadow-lg);
}

.spotly-card-elevated:hover {
    box-shadow: var(--spotly-shadow-xl);
    transform: translateY(-4px);
}

.spotly-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spotly-space-lg);
}

.spotly-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--spotly-text);
}

/* ========== BUTTONS ========== */
.spotly-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spotly-space-sm);
    padding: var(--spotly-space-md) var(--spotly-space-lg);
    border-radius: var(--spotly-radius);
    font-family: var(--spotly-font);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--spotly-transition-fast);
}

.spotly-btn-primary {
    background: var(--spotly-text);
    color: var(--spotly-surface);
}

.spotly-btn-primary:hover {
    background: var(--spotly-secondary-dark);
    transform: translateY(-1px);
}

.spotly-btn-secondary {
    background: var(--spotly-main);
    color: var(--spotly-text);
    border: 1px solid var(--spotly-border);
}

.spotly-btn-secondary:hover {
    background: var(--spotly-surface-hover);
    border-color: var(--spotly-secondary);
}

.spotly-btn-success {
    background: var(--spotly-success);
    color: white;
}

.spotly-btn-success:hover {
    background: #229954;
}

.spotly-btn-error {
    background: var(--spotly-error);
    color: white;
}

.spotly-btn-error:hover {
    background: #CB4335;
}

.spotly-btn-ghost {
    background: transparent;
    color: var(--spotly-text);
}

.spotly-btn-ghost:hover {
    background: var(--spotly-surface-hover);
}

.spotly-btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--spotly-radius);
}

/* ========== FORM INPUTS ========== */
.spotly-input {
    width: 100%;
    padding: var(--spotly-space-md) var(--spotly-space-lg);
    font-family: var(--spotly-font);
    font-size: 1rem;
    color: var(--spotly-text);
    background: var(--spotly-surface);
    border: 2px solid var(--spotly-border);
    border-radius: var(--spotly-radius);
    outline: none;
    transition: all var(--spotly-transition-fast);
}

.spotly-input:hover {
    border-color: var(--spotly-secondary);
}

.spotly-input:focus {
    border-color: var(--spotly-text);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

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

/* ========== BADGES & CHIPS ========== */
.spotly-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spotly-space-xs);
    padding: var(--spotly-space-xs) var(--spotly-space-md);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 100px;
}

.spotly-badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--spotly-success);
}

.spotly-badge-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--spotly-error);
}

.spotly-badge-warning {
    background: rgba(243, 156, 18, 0.1);
    color: var(--spotly-warning);
}

.spotly-badge-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--spotly-info);
}

.spotly-badge-neutral {
    background: var(--spotly-main);
    color: var(--spotly-text);
}

/* ========== STATUS INDICATORS ========== */
.spotly-status {
    display: flex;
    align-items: center;
    gap: var(--spotly-space-sm);
}

.spotly-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.spotly-status-dot.online { background: var(--spotly-success); }
.spotly-status-dot.away { background: var(--spotly-warning); }
.spotly-status-dot.offline { background: var(--spotly-secondary); }

/* ========== TABLES ========== */
.spotly-table {
    width: 100%;
    border-collapse: collapse;
}

.spotly-table th,
.spotly-table td {
    padding: var(--spotly-space-md);
    text-align: left;
    border-bottom: 1px solid var(--spotly-border);
}

.spotly-table th {
    font-weight: 600;
    color: var(--spotly-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.spotly-table tbody tr:hover {
    background: var(--spotly-surface-hover);
}

/* ========== WEEK GRID ========== */
.spotly-week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spotly-space-md);
}

@media (max-width: 768px) {
    .spotly-week-grid {
        grid-template-columns: 1fr;
    }
}

.spotly-day-column {
    background: var(--spotly-surface);
    border-radius: var(--spotly-radius-lg);
    overflow: hidden;
    box-shadow: var(--spotly-shadow-sm);
    transition: all var(--spotly-transition);
}

.spotly-day-column:hover {
    box-shadow: var(--spotly-shadow);
}

.spotly-day-header {
    padding: var(--spotly-space-md);
    background: var(--spotly-main);
    text-align: center;
}

.spotly-day-header.today {
    background: var(--spotly-text);
    color: var(--spotly-surface);
}

.spotly-day-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.spotly-day-date {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.spotly-day-body {
    padding: var(--spotly-space-md);
}

/* ========== CHARTS ========== */
.spotly-chart-container {
    padding: var(--spotly-space-lg);
    background: var(--spotly-surface);
    border-radius: var(--spotly-radius-lg);
}

.spotly-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spotly-space-md);
    margin-top: var(--spotly-space-md);
}

.spotly-chart-legend-item {
    display: flex;
    align-items: center;
    gap: var(--spotly-space-sm);
    font-size: 0.875rem;
    color: var(--spotly-text-light);
}

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

/* ========== AVATARS ========== */
.spotly-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--spotly-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--spotly-text);
}

.spotly-avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.spotly-avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.spotly-avatar-xl { width: 80px; height: 80px; font-size: 1.75rem; }

.spotly-avatar-stack {
    display: flex;
}

.spotly-avatar-stack .spotly-avatar {
    border: 2px solid var(--spotly-surface);
    margin-left: -12px;
}

.spotly-avatar-stack .spotly-avatar:first-child {
    margin-left: 0;
}

/* ========== LOADING STATES ========== */
.spotly-skeleton {
    background: linear-gradient(90deg, var(--spotly-main) 25%, var(--spotly-secondary-light) 50%, var(--spotly-main) 75%);
    background-size: 200% 100%;
    animation: spotly-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--spotly-radius-sm);
}

.spotly-skeleton-text {
    height: 1em;
    margin-bottom: var(--spotly-space-sm);
}

.spotly-skeleton-circle {
    border-radius: 50%;
}

/* ========== RESPONSIVE UTILITIES ========== */
@media (max-width: 1024px) {
    .spotly-sidebar {
        transform: translateX(-100%);
    }
    
    .spotly-sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    :root {
        --spotly-space-lg: 20px;
        --spotly-space-xl: 28px;
    }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--spotly-main);
}

::-webkit-scrollbar-thumb {
    background: var(--spotly-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--spotly-secondary-dark);
}

/* ========== FOCUS STATES ========== */
*:focus-visible {
    outline: 2px solid var(--spotly-text);
    outline-offset: 2px;
}

