/* ========================================
   FILE 1: assets/css/variables.css
   CSS Variables & Design Tokens
   ======================================== */

:root {
    /* Colors - Light Mode */
    --bg: #FFFFFF;
    --surface: #FAFAFB;
    --card: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #666666;
    --accent: #0071E3;
    --muted-border: #E6E6E6;
    --success: #28C76F;
    --error: #FF453A;
    --warning: #FFB800;
    --info: #0071E3;
    
    /* Radius */
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    
    /* Transitions */
    --transition: 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
    --transition-fast: 150ms cubic-bezier(0.2, 0.9, 0.3, 1);
    
    /* Shadows */
    --shadow: 0 6px 20px rgba(17, 17, 17, 0.06);
    --shadow-sm: 0 2px 8px rgba(17, 17, 17, 0.04);
    --shadow-lg: 0 12px 40px rgba(17, 17, 17, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0B0B0C;
        --surface: #131313;
        --card: #1A1A1A;
        --text-primary: #F4F4F5;
        --text-secondary: #C8C8CC;
        --accent: #4DA6FF;
        --muted-border: #333333;
        --shadow: 0 6px 20px rgba(255, 255, 255, 0.05);
    }
}

/* ========================================
   FILE 2: assets/css/base.css
   Reset & Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-border);
    border-radius: var(--radius-pill);
}

/* ========================================
   FILE 3: assets/css/components.css
   Reusable Components
   ======================================== */

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Message Bubbles */
.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    animation: fadeSlideUp 300ms ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.message-sent {
    align-self: flex-end;
    background: #34C759;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received {
    align-self: flex-start;
    background: #2C2C2E;
    color: white;
    border-bottom-left-radius: 4px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(52, 199, 89, 0.15);
    color: #34C759;
}

.status-badge.away {
    background: rgba(255, 184, 0, 0.15);
    color: #FFB800;
}

.status-badge.offline {
    background: var(--surface);
    color: var(--text-secondary);
}

/* Avatars */
.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #00a8ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

/* ========================================
   FILE 4: assets/css/layout.css
   Layout & Responsive Grid
   ======================================== */

/* Chat Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    height: calc(100vh - 80px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: 200px 1fr;
        gap: 16px;
    }
    .details-panel { display: none; }
}

@media (max-width: 600px) {
    .chat-layout {
        grid-template-columns: 1fr;
        padding: 0;
        height: 100vh;
    }
    .sidebar { display: none; }
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

/* Composer */
.composer {
    padding: 16px 20px;
    border-top: 2px solid var(--muted-border);
    background: var(--card);
}

@media (max-width: 600px) {
    .composer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
}

/* ========================================
   FILE 5: assets/css/utilities.css
   Utility Classes
   ======================================== */

.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}