:root {
    /* shadcn/ui color system */
    --background: 224 71% 4%;
    --foreground: 213 31% 91%;
    --muted: 223 47% 11%;
    --muted-foreground: 215.4 16.3% 56.9%;
    --popover: 224 71% 4%;
    --popover-foreground: 215 20.2% 65.1%;
    --border: 216 34% 17%;
    --input: 216 34% 17%;
    --card: 224 71% 4%;
    --card-foreground: 213 31% 91%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 222.2 47.4% 11.2%;
    --secondary-foreground: 210 40% 98%;
    --accent: 216 34% 17%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 63% 31%;
    --destructive-foreground: 210 40% 98%;
    --ring: 216 34% 17%;
    --radius: 0.5rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    border-bottom: 1px solid hsl(var(--border));
    padding: 0.75rem 1.5rem;
    background: hsl(var(--background));
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    max-width: 58rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 32px;
    width: auto;
}

.theme-toggle {
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: hsl(var(--accent));
}

/* Tab Navigation */
.tab-nav {
    border-bottom: 1px solid hsl(var(--border));
    padding: 0 1.5rem;
    background: hsl(var(--background));
    position: sticky;
    top: 57px;
    z-index: 40;
    max-width: 58rem;
    margin: 0 auto;
}

.tab-button {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    padding: 0.75rem 1rem;
    margin-right: 0.5rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover {
    color: hsl(var(--foreground));
    background: hsl(var(--muted));
}

.tab-button.active {
    color: hsl(var(--primary));
    border-bottom-color: hsl(var(--primary));
}

.tab-icon {
    font-size: 1.1rem;
}

/* Main Container */
.main-container {
    max-width: 58rem;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Home Tab - Chat */
.chat-container {
    min-height: 400px;
    margin-bottom: 1.5rem;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: hsl(var(--muted-foreground));
}

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

.message {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    animation: slideIn 0.2s ease-out;
}

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

.message.user {
    background: hsl(var(--muted));
}

.message.assistant {
    background: transparent;
}

.message-avatar {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    flex: 1;
    line-height: 1.6;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.quick-actions-dashboard {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chip {
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--foreground));
    font-weight: 500;
}

.chip:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--primary));
}

.chip-icon {
    font-size: 1rem;
}

/* Chat Input */
.chat-input-container {
    position: sticky;
    bottom: 0;
    background: hsl(var(--background));
    padding: 1rem 0;
    border-top: 1px solid hsl(var(--border));
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.input-wrapper {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    cursor: text;
}

.input-wrapper:focus-within {
    border-color: hsl(210 100% 50%);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: hsl(var(--foreground));
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    max-height: 200px;
    min-height: 40px;
    width: 100%;
    padding: 0.5rem 0;
}

.chat-input::placeholder {
    color: hsl(var(--muted-foreground));
}

.input-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.voice-btn {
    background: hsl(var(--destructive));
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-btn:hover {
    opacity: 0.9;
}

.send-btn {
    background: hsl(210 100% 50%);
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn:hover {
    background: hsl(210 100% 45%);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dashboard */
.dashboard-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
}

.card-content {
    padding: 1rem 1.25rem;
}

.badge {
    background: hsl(var(--destructive));
    color: white;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.empty-state-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: hsl(var(--muted-foreground));
    font-size: 14px;
}

.empty-icon-small {
    font-size: 1.25rem;
}

/* Task Items */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: -0.75rem -1.25rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.task-item:last-child {
    margin-bottom: -0.75rem;
}

.task-item:hover {
    background: hsl(var(--muted));
}

.task-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid hsl(var(--border));
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.task-checkbox.checked {
    background: hsl(210 100% 50%);
    border-color: hsl(210 100% 50%);
    position: relative;
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 14px;
    line-height: 1.5;
    color: hsl(var(--foreground));
}

.task-title.completed {
    text-decoration: line-through;
    color: hsl(var(--muted-foreground));
}

.task-delete {
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: all 0.2s;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.task-delete:hover {
    color: hsl(var(--destructive));
}

/* Event Items */
.event-item {
    padding: 0.75rem;
    margin: -0.75rem -1.25rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid hsl(210 100% 50%);
    background: hsl(var(--muted) / 0.3);
}

.event-item:last-child {
    margin-bottom: -0.75rem;
}

.event-time {
    font-size: 12px;
    color: hsl(var(--muted-foreground));
    margin-bottom: 0.25rem;
}

.event-title {
    font-size: 14px;
    font-weight: 500;
    color: hsl(var(--foreground));
}

/* Responsive */
@media (max-width: 768px) {
    .header-content,
    .tab-nav,
    .main-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .chat-input-container {
        margin: 0 -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Light Theme */
body.light {
    --background: 0 0% 100%;
    --foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 47.4% 11.2%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 47.4% 11.2%;
    --primary: 222.2 47.4% 11.2%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 100% 50%;
    --destructive-foreground: 210 40% 98%;
    --ring: 215 20.2% 65.1%;
}

body.light .logo-dark {
    display: none;
}

body.light .logo-light {
    display: block !important;
}
