/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark minimalistic theme - default */
    --tg-theme-bg-color: #0f0f0f;
    --tg-theme-text-color: #e4e4e7;
    --tg-theme-hint-color: #71717a;
    --tg-theme-link-color: #3b82f6;
    --tg-theme-button-color: #3b82f6;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #18181b;

    /* Custom colors - dark theme */
    --border-color: #27272a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;

    /* High-tech gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-cyber: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);

    /* Status colors - adjusted for dark theme */
    --status-in-progress: #3b82f6;
    --status-completed: #10b981;
    --status-on-hold: #f59e0b;
    --status-overdue: #ef4444;
    --status-closed: #6b7280;

    /* Neon colors */
    --neon-blue: #00d9ff;
    --neon-cyan: #00ffff;
    --neon-purple: #b444ff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--tg-theme-bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background-color: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.15s;
    color: var(--tg-theme-text-color);
}

.btn-icon:active {
    opacity: 0.6;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    font-size: 16px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--tg-theme-button-color);
}

/* Menu Panel */
.menu-panel {
    padding: 8px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-bottom: 1px solid var(--border-color);
    animation: slideDown 0.2s ease;
}

.menu-item {
    width: 100%;
    padding: 14px 16px;
    background-color: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    font-size: 15px;
    font-weight: 500;
}

.menu-item:active {
    background-color: var(--tg-theme-bg-color);
}

.menu-item svg {
    opacity: 0.7;
}

/* Filter Panel */
.filter-panel {
    padding: 16px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-bottom: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chip.active {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border-color: var(--tg-theme-button-color);
}

.chip:active {
    transform: scale(0.95);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 16px;
    overflow-x: auto;
}

/* Kanban View */
.kanban-view {
    display: flex;
    gap: 16px;
    min-height: 400px;
    padding-bottom: 20px;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.column-header h3 {
    font-size: 14px;
    font-weight: 500;
}

.column-header.warning h3 {
    color: var(--status-overdue);
}

.column-header.success h3 {
    color: var(--status-completed);
}

.task-count {
    background-color: var(--tg-theme-bg-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.column-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Task Card */
.task-card {
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.task-card:active {
    opacity: 0.7;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.task-card-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.task-priority {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    margin-top: 6px;
}

.task-priority.high {
    background-color: var(--status-overdue);
}

.task-priority.medium {
    background-color: var(--status-on-hold);
}

.task-priority.low {
    background-color: var(--status-completed);
}

.task-card-description {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tg-theme-button-color), var(--status-completed));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.task-deadline {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-deadline.overdue {
    color: var(--status-overdue);
    font-weight: 600;
}

.task-deadline.soon {
    color: var(--status-on-hold);
    font-weight: 600;
}

/* List View */
.list-view {
    animation: fadeIn 0.3s ease;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-list-item {
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.task-list-item:active {
    opacity: 0.7;
}

.task-status-indicator {
    width: 4px;
    height: 48px;
    border-radius: 2px;
}

.task-status-indicator.in_progress {
    background-color: var(--status-in-progress);
}

.task-status-indicator.completed {
    background-color: var(--status-completed);
}

.task-status-indicator.on_hold {
    background-color: var(--status-on-hold);
}

.task-status-indicator.overdue {
    background-color: var(--status-overdue);
}

.task-list-content {
    flex: 1;
}

.task-list-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.task-list-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    color: var(--tg-theme-hint-color);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-end;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background-color: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: var(--tg-theme-bg-color);
    z-index: 10;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
    padding-right: 16px;
}

.modal-body {
    padding: 20px;
}

.task-detail-section {
    margin-bottom: 24px;
}

.task-detail-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-detail-section p {
    font-size: 15px;
    line-height: 1.6;
}

.task-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.deadline-info {
    padding: 8px 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.status-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    font-size: 16px;
    outline: none;
}

.subtasks-list,
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-item,
.history-item {
    padding: 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.history-change {
    flex: 1;
}

.history-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    white-space: nowrap;
    margin-left: 12px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--tg-theme-text-color);
}

.file-icon {
    width: 32px;
    height: 32px;
    background-color: var(--tg-theme-button-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.selected-files-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.selected-file-name {
    font-size: 14px;
    color: var(--tg-theme-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-file-size {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    white-space: nowrap;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.remove-file-btn:hover {
    color: #ef4444;
}

.helper-text {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 12px;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background-color: var(--tg-theme-bg-color);
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.btn-secondary {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

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

/* Page Content */
.page-content {
    padding: 16px;
}

.page-section {
    margin-bottom: 24px;
}

.page-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.page-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

/* Settings */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--tg-theme-button-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Help Content */
.help-content p {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--tg-theme-button-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* FAB Button */
.fab-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 100;
}

.fab-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
}

.fab-button:active {
    transform: scale(0.95);
}

.fab-button svg {
    width: 24px;
    height: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--tg-theme-text-color);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
}

/* Voice Input Styles */
.input-with-voice {
    position: relative;
}

.input-with-voice textarea,
.input-with-voice .ai-message-input {
    padding-right: 48px !important;
}

.voice-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.recording {
    background: var(--gradient-danger);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.voice-btn.processing {
    background: var(--gradient-warning);
    pointer-events: none;
}

.voice-btn.processing svg {
    animation: spin 1s linear infinite;
}

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

.form-error {
    display: block;
    color: var(--status-overdue);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
}

/* Team List Styles */
.team-member {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-md);
}

.team-member-info {
    flex: 1;
}

.team-member-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.team-member-details {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.team-member-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-small:hover {
    background: var(--tg-theme-secondary-bg-color);
    border-color: var(--tg-theme-button-color);
}

.btn-icon-small svg {
    width: 16px;
    height: 16px;
}

.btn-icon-small.btn-delete {
    color: var(--tg-theme-hint-color);
    border-color: transparent;
}

.btn-icon-small.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-icon-btn:hover {
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-button-color);
    transform: scale(1.1);
}

.edit-icon-btn:active {
    transform: scale(0.95);
}

.edit-icon-btn svg {
    width: 16px;
    height: 16px;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.role-badge.manager {
    background: var(--gradient-primary);
    color: white;
}

.role-badge.employee {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
}

/* AI Chat Styles */
.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ai-chat-container {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    height: 60vh;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.ai-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message.assistant {
    align-self: flex-start;
}

.ai-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ai-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.ai-message.assistant .ai-message-avatar {
    background: var(--border-color);
}

.ai-message-content {
    background: var(--tg-theme-bg-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message.user .ai-message-content {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
}

.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tg-theme-hint-color);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

.ai-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-message-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--tg-theme-text-color);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
}

.ai-message-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* High-Tech Enhancements */

/* Glass-morphism effect for modals */
.modal-content {
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

/* Glow border for active elements */
.glow-border {
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

/* Pulse animation for important elements */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* Improved button styles with gradients */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

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

/* Enhanced task cards with hover effects */
.task-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Slide-in animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease;
}

/* Neon text effect for headings */
.neon-text {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* Cyber grid background pattern */
.cyber-grid {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Status badge with glow */
.status-badge {
    position: relative;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-badge.in_progress {
    background: var(--gradient-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.status-badge.completed {
    background: var(--gradient-success);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.status-badge.overdue {
    background: var(--gradient-danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Loading spinner with gradient */
.spinner {
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .task-detail-row {
        grid-template-columns: 1fr;
    }

    .kanban-view {
        flex-direction: column;
    }

    .kanban-column {
        max-width: none;
    }

    .fab-button {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .fab-button svg {
        width: 20px;
        height: 20px;
    }
}
