:root {
    /* Light theme colors */
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --accent-color: #4cc9f0;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    
    /* Background colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    
    /* Text colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    
    /* Border colors */
    --border-color: #dee2e6;
    --border-light: #e9ecef;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

[data-theme="dark"] {
    --primary-color: #5a7dfe;
    --primary-dark: #4361ee;
    --secondary-color: #9d4edd;
    --accent-color: #4cc9f0;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-tertiary: #6c757d;
    
    --border-color: #495057;
    --border-light: #343a40;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal);
    overflow-x: hidden;
}

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

/* Header Styles */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
    color: var(--accent-color);
}

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

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-icon {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

.btn-nav {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.btn-nav:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.btn-nav.next-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
}

.btn-nav.next-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-skip {
    background: transparent;
    color: var(--text-secondary);
    border: 2px dashed var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-skip:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: rgba(239, 71, 111, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Questionnaire Section */
.questionnaire-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.questionnaire-section.active {
    display: block;
}

.question-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-light);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width var(--transition-slow) ease;
    width: 4%;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.question-counter {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.category-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.question-text {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
    min-height: 84px;
}

.question-input-container {
    margin-bottom: 2rem;
}

.answer-input {
    width: 100%;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: var(--bg-primary);
}

.input-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.char-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.nav-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.question-categories {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.categories-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.category-pill {
    padding: 8px 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.category-pill:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-pill.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Kanban Section */
.kanban-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.kanban-section.active {
    display: block;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.kanban-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-item i {
    color: var(--primary-color);
}

.kanban-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
}

.search-box i {
    color: var(--text-tertiary);
    margin-right: 8px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
}

.search-box input:focus {
    outline: none;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.kanban-column {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.column-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.column-count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

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

.column-actions button {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.column-actions button:hover {
    color: var(--text-primary);
}

.column-tasks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100px;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.column-tasks.drag-over {
    background: rgba(67, 97, 238, 0.05);
    border: 2px dashed var(--primary-color);
}

.task-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    cursor: move;
    transition: all var(--transition-normal);
    position: relative;
    animation: slideIn 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.task-card.high {
    border-left: 4px solid var(--danger-color);
}

.task-card.medium {
    border-left: 4px solid var(--warning-color);
}

.task-card.low {
    border-left: 4px solid var(--success-color);
}

.task-card.critical {
    border-left: 4px solid #ff2e63;
    background: linear-gradient(to right, rgba(255, 46, 99, 0.05), var(--bg-primary));
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.task-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-right: 8px;
}

.task-priority {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-priority.high {
    background: rgba(239, 71, 111, 0.15);
    color: var(--danger-color);
}

.task-priority.medium {
    background: rgba(255, 209, 102, 0.15);
    color: #e6b400;
}

.task-priority.low {
    background: rgba(6, 214, 160, 0.15);
    color: var(--success-color);
}

.task-priority.critical {
    background: rgba(255, 46, 99, 0.15);
    color: #ff2e63;
}

.task-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.task-assignee {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.assignee-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.task-due {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due.overdue {
    color: var(--danger-color);
    font-weight: 600;
}

.task-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.task-card:hover .task-actions {
    opacity: 1;
}

.task-actions button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.task-actions button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.task-actions .delete-btn:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

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

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    display: none;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

.loading-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.loading-content p {
    opacity: 0.9;
    margin-bottom: 2rem;
}

.loading-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.loading-progress .progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress .progress-fill {
    background: white;
    height: 100%;
    transition: width 0.3s ease;
}

#loadingPercent {
    font-weight: 600;
    font-size: 14px;
    min-width: 40px;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1rem;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast i {
    font-size: 1.25rem;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1rem;
    z-index: 1000;
    display: none;
    border: 1px solid var(--border-light);
    animation: slideUp 0.3s ease;
}

.install-prompt.active {
    display: block;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.install-content i {
    font-size: 2rem;
    color: var(--primary-color);
}

.install-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.install-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.btn-text:hover {
    color: var(--text-primary);
}

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .question-container {
        padding: 2rem 1.5rem;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .kanban-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .project-stats {
        justify-content: space-between;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-nav {
        min-width: 100%;
    }
    
    .categories-nav {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .install-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .question-container {
        padding: 1.5rem 1rem;
    }
    
    .question-text {
        font-size: 1.25rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Drag and Drop Effects */
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
    box-shadow: var(--shadow-lg);
}

.column-tasks.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-style: italic;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
