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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

/* High contrast text for accessibility */
h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a;
    font-weight: 600;
}

p, span, div {
    color: #2c3e50;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Login Modal */
.rocket-container {
    text-align: center;
    margin-bottom: 2rem;
}

.rocket-svg {
    width: 80px;
    height: 80px;
    animation: rocketFloat 3s ease-in-out infinite;
}

@keyframes rocketFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

#loginModal h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.hint {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.hint code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

/* Header scroll behavior - hide when scrolling down on mobile */
@media (max-width: 768px) {
    .header.hidden {
        transform: translateY(-100%);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.rocket-icon {
    width: 32px;
    height: 32px;
    color: #FF6B6B;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B6B, #4ECDC4);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: #FF6B6B;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

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

.char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Color Picker */
.color-picker {
    margin-bottom: 1.5rem;
}

.color-picker label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.color-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-options input[type="radio"] {
    display: none;
}

.color-options label {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.color-options input[type="radio"]:checked + label {
    border-color: #2c3e50;
    transform: scale(1.1);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    width: 100%;
}

/* Epics Container */
.epics-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 0 1rem 1rem 1rem;
    align-items: flex-start;
    justify-content: center;
    scroll-behavior: smooth;
}

.epic-column {
    min-width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    position: relative;
}

.epic-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f8f9fa;
}

.epic-pastille {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.epic-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.epic-name:hover {
    background-color: #f8f9fa;
}

.epic-name.editing {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

/* Clickable text styling */
.clickable-text {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem;
}

.clickable-text:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.clickable-text.editing {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    outline: none;
}

.epic-actions {
    display: flex;
    gap: 0.5rem;
}

.epic-actions button {
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.epic-actions button:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Tasks */
.tasks-container {
    /* Dynamic height based on content */
}

.task-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.task-item.completed {
    background: #d4edda;
    border-color: #c3e6cb;
    opacity: 0.7;
}

.task-content {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem;
}

.task-content:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.task-content.editing {
    background-color: white;
    border: 1px solid #FF6B6B;
    border-radius: 4px;
    padding: 0.5rem;
    outline: none;
    font-family: inherit;
    resize: none;
    width: 100%;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.task-date {
    font-style: italic;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.task-actions button {
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.task-actions button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #495057;
}

.task-actions .complete-btn:hover {
    color: #28a745;
}

.task-actions .delete-btn:hover {
    color: #dc3545;
}

/* Add Task Button */
.add-task-btn {
    width: 100%;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-task-btn:hover {
    background: #e9ecef;
    border-color: #FF6B6B;
    color: #FF6B6B;
}

/* Panels */
.completed-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.activity-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.completed-panel.open,
.activity-panel.open {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.panel-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Activity Stats */
.activity-stats {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #FF6B6B;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Activity Log */
.activity-log {
    padding: 1rem 1.5rem;
}

.activity-item {
    padding: 1rem;
    border-left: 3px solid #FF6B6B;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.activity-item-clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-item-clickable:hover {
    background: #e9ecef;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.activity-action {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.activity-details {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.activity-hint {
    font-size: 0.8rem;
    color: #FF6B6B;
    font-style: italic;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.activity-time {
    font-size: 0.8rem;
    color: #adb5bd;
    font-style: italic;
}

/* Completed Tasks */
.completed-tasks {
    padding: 1rem 1.5rem;
}

.completed-task {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.completed-task:hover {
    background: #c3e6cb;
    transform: translateX(-5px);
}

.completed-task-content {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-decoration: line-through;
    opacity: 0.7;
}

.completed-task-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF6B6B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    border-left: 4px solid #FF6B6B;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: toastSlideIn 0.3s ease-out;
    max-width: 300px;
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Simple Paper-like Drag and Drop */
.task-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    z-index: 1000;
}

.drag-ghost {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.task-item.drag-over {
    border-top: 3px solid #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.task-item.drag-over-bottom {
    border-bottom: 3px solid #FF6B6B;
    background: rgba(255, 107, 107, 0.1);
}

.epic-column.drag-over {
    border: 2px dashed #FF6B6B;
    background: rgba(255, 107, 107, 0.05);
    border-radius: 12px;
}


.tasks-container.drag-over {
    border-radius: 8px;
    min-height: 50px;
    position: relative;
}

.tasks-container.drag-over::after {
    content: "Drop here to reorder";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF6B6B;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.7;
    pointer-events: none;
}

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

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Responsive Design - Mobile Optimized */
@media (max-width: 768px) {
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
    }
    
    .header-content {
        padding: 0.5rem 0.75rem;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .rocket-icon {
        width: 20px;
        height: 20px;
    }
    
    .header-actions {
        width: auto;
        justify-content: flex-end;
        gap: 0.25rem;
        flex-shrink: 0;
    }
    
    .btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 0.25rem 0;
        padding-top: 3rem; /* Account for fixed header */
    }
    
    .epics-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 0.5rem 0.5rem 0.5rem;
    }
    
    .epic-column {
        min-width: auto;
        width: 100%;
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .epic-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .epic-pastille {
        width: 16px;
        height: 16px;
    }
    
    .epic-name {
        font-size: 1rem;
    }
    
    .epic-actions button {
        font-size: 0.9rem;
        padding: 0.2rem;
    }
    
    .task-item {
        padding: 0.6rem;
        margin-bottom: 0.5rem;
        border-radius: 6px;
        /* Better touch handling */
        touch-action: pan-y;
        -webkit-tap-highlight-color: transparent;
    }
    
    .task-content {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.3rem;
        padding: 0.15rem;
    }
    
    .task-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
    }
    
    .task-date {
        font-size: 0.65rem;
    }
    
    .task-actions {
        gap: 0.25rem;
    }
    
    .task-actions button {
        padding: 0.15rem;
        font-size: 0.85rem;
    }
    
    .add-task-btn {
        display: none; /* Hidden on mobile - use + button in epic header instead */
    }
    
    .completed-panel {
        width: 100%;
    }
    
    .activity-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .panel-header {
        padding: 1rem;
    }
    
    .panel-header h3 {
        font-size: 1.1rem;
    }
    
    .activity-stats {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .stat {
        flex: 1;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .activity-log {
        padding: 0.75rem 1rem;
    }
    
    .activity-item {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .activity-action {
        font-size: 0.9rem;
    }
    
    .activity-details {
        font-size: 0.85rem;
    }
    
    .activity-time {
        font-size: 0.75rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        padding: 1.25rem;
        max-width: calc(100% - 1rem);
    }
    
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        max-width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.4rem 0.5rem;
    }
    
    .logo h1 {
        font-size: 0.9rem;
    }
    
    .rocket-icon {
        width: 18px;
        height: 18px;
    }
    
    .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .main-content {
        padding-top: 2.75rem;
    }
    
    .epic-column {
        padding: 0.6rem;
    }
    
    .epic-header {
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }
    
    .epic-pastille {
        width: 14px;
        height: 14px;
    }
    
    .epic-name {
        font-size: 0.95rem;
    }
    
    .task-item {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
    }
    
    .task-content {
        font-size: 0.8rem;
        line-height: 1.35;
    }
    
    .task-meta {
        font-size: 0.65rem;
    }
    
    .task-date {
        font-size: 0.6rem;
    }
    
    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}
