/* Apple-Inspired Zen Design System */
/* Clean, Minimal, Beautiful - As Steve Jobs Would Have Wanted */

@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Apple-inspired color palette */
    --primary-color: #007AFF;
    --secondary-color: #5AC8FA;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    
    /* Clean backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F7;
    --bg-tertiary: #FAFAFA;
    --bg-card: #FFFFFF;
    
    /* Text colors */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #8E8E93;
    --text-inverse: #FFFFFF;
    
    /* Borders and shadows */
    --border-light: #E5E5EA;
    --border-medium: #D2D2D7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.16);
    
    /* Animations */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: 48px; font-weight: 700; }
h2 { font-size: 36px; }
h3 { font-size: 28px; }
h4 { font-size: 24px; }
h5 { font-size: 20px; }
h6 { font-size: 18px; }

/* Hero Section - Apple Style */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: var(--bg-primary);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.05) 0%, 
        rgba(90, 200, 250, 0.05) 100%);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: var(--text-primary);
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Feature Cards - Apple Style */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 24px;
    display: inline-block;
    transition: transform var(--transition-fast);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card h3 {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 16px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

/* Chat Interface - Clean Apple Design */
.chat-container {
    display: flex;
    height: 100vh;
    background: var(--bg-secondary);
}

/* Agents Sidebar - Minimal Design */
.agents-sidebar {
    width: 320px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.sidebar-header h5 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.agent-status {
    color: var(--success-color);
    font-size: 14px;
    font-weight: 500;
}

.agents-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Agent Cards - Beautiful and Clean */
.agent-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.agent-card:hover {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.agent-card.active {
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.1) 0%, 
        rgba(90, 200, 250, 0.1) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.15);
}

.agent-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.agent-info {
    flex: 1;
}

.agent-info strong {
    display: block;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.agent-info small {
    color: var(--text-secondary);
    font-size: 13px;
    display: block;
}

.agent-personality {
    color: var(--primary-color);
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

/* Chat Main Area - Clean Interface */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-header {
    padding: 24px 32px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-header h4 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-controls {
    display: flex;
    gap: 12px;
}

.header-controls .btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-controls .btn:hover {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
}

/* Messages Area - Beautiful Chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--bg-primary);
}

.message {
    margin-bottom: 24px;
    animation: messageSlide 0.4s ease-out;
}

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

.message.user-message {
    display: flex;
    justify-content: flex-end;
}

.message.agent-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.message-content {
    padding: 16px 20px;
    border-radius: 18px;
    max-width: 70%;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.agent-message .message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-inverse);
    border: none;
}

.system-message .message-content {
    background: linear-gradient(135deg, 
        rgba(255, 149, 0, 0.1) 0%, 
        rgba(255, 204, 0, 0.1) 100%);
    border: 1px solid rgba(255, 149, 0, 0.3);
    max-width: 100%;
    text-align: center;
    color: var(--text-primary);
}

.message-header {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Area - Clean Design */
.chat-input-container {
    padding: 24px 32px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
    outline: none;
}

#messageInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

#messageInput::placeholder {
    color: var(--text-tertiary);
}

/* Buttons - Apple Style */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-inverse);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-inverse);
}

/* Microphone Button Animation */
#micBtn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: var(--warning-color);
    color: var(--text-inverse);
    position: relative;
}

#micBtn.btn-danger {
    background: var(--danger-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* VU Meter - Minimal Style */
#vuMeterContainer {
    background: var(--bg-tertiary);
    padding: 16px;
    border-radius: 12px;
    margin: 16px 32px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#vuMeter {
    width: 100%;
    height: 60px;
    border-radius: 8px;
}

/* Auth Pages - Clean Login */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-secondary);
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.03) 0%, 
        rgba(90, 200, 250, 0.03) 100%);
}

.auth-card {
    background: var(--bg-primary);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    position: relative;
    min-width: 400px;
}

.auth-card h3 {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
}

.form-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Admin Dashboard - Clean Stats */
.stat-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    transition: all var(--transition-medium);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.stat-card h3 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card p {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scrollbar - Minimal Design */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 10px;
    border: 2px solid var(--bg-tertiary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Typing Indicator - Clean Design */
.typing-indicator .message-content {
    background: var(--bg-tertiary);
    padding: 16px 20px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { 
        transform: scale(1);
        opacity: 0.5;
    }
    30% { 
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
    .agents-sidebar {
        position: fixed;
        left: -320px;
        height: 100vh;
        z-index: 1000;
        transition: left var(--transition-medium);
        box-shadow: var(--shadow-xl);
    }
    
    .agents-sidebar.show {
        left: 0;
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .hero-section h1 {
        font-size: 36px;
    }
    
    .hero-section p {
        font-size: 18px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Focus Styles for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(52, 199, 89, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(255, 59, 48, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(255, 149, 0, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
}

/* Tables - Clean Design */
.table {
    width: 100%;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.table td {
    padding: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: var(--bg-tertiary);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-primary {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.badge.bg-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
}

.badge.bg-danger {
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
}

.badge.bg-warning {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning-color);
}

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

.modal-content {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
}