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

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

:root {
    --primary-blue: #00ff88; 
    --primary-purple: #10b981; 
    --primary-green: #00ff88;
    --primary-orange: #ff6b35;
    --primary-red: #ff4757;
    --accent-cyan: #34d399; 
    --success-green: #10b981;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --bg-primary: #000000;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --border-primary: rgba(255, 255, 255, 0.2);
    --border-accent: #00ff88; 
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 255, 136, 0.3); 
}

body {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent; /* Prevent tap highlight on mobile */
    touch-action: manipulation; /* Prevent double-tap zoom */
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--primary-green);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
}

.header {
    text-align: center;
    margin-bottom: 60px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

.main-title {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Adjusted for mobile */
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-purple), var(--accent-cyan)); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 0 50px rgba(0, 255, 136, 0.6); 
    letter-spacing: -0.03em;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem); /* Adjusted for mobile */
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.8;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 30px; /* Reduced gap for mobile */
    margin-bottom: 60px;
    align-items: start;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 16px; /* Slightly smaller for mobile */
    padding: 24px; /* Reduced padding */
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(20px); /* Reduced translate for mobile */
    animation: fadeInUp 1s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-card:hover {
    transform: translateY(-4px); /* Reduced for mobile */
    box-shadow: var(--shadow-glow);
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.glass-card:hover::before {
    opacity: 1;
}

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

.stats-card {
    animation-delay: 0.3s;
}

.tasks-card {
    animation-delay: 0.5s;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0; /* Reduced padding */
    border-bottom: 1px solid var(--border-primary);
    font-weight: 500;
    font-size: 0.9rem; /* Slightly smaller for mobile */
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-number {
    font-size: 1.3rem; /* Adjusted for mobile */
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-cyan)); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px; /* Adjusted for touch */
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    min-width: 100px; /* Ensure buttons are touch-friendly */
    touch-action: manipulation; /* Prevent zoom on double-tap */
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s;
    transform: translate(-50%, -50%);
}

.btn:hover::before, .btn:active::before {
    width: 200px; /* Reduced for mobile */
    height: 200px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-purple)); 
    color: white;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3); 
}

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

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

.btn-secondary:hover, .btn-secondary:active {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.task-group {
    margin-bottom: 24px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 16px; /* Adjusted for mobile */
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    transition: all 0.3s;
    margin-bottom: 12px;
}

.group-header:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.group-toggle {
    transition: transform 0.3s;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.group-toggle.expanded {
    transform: rotate(90deg);
}

.group-title {
    font-weight: 600;
    font-size: 1rem;
}

.task-count {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-cyan)); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.task-item {
    padding: 16px; /* Adjusted for mobile */
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 1px solid var(--border-primary);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-cyan)); 
    opacity: 0;
    transition: opacity 0.3s;
}

.task-item:hover, .task-item:active {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.task-item::before {
    opacity: 1;
}

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

.task-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.task-id {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'SF Mono', monospace;
}

.task-status {
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-working-on-it {
    background: linear-gradient(135deg, var(--warning-orange), #fbbf24);
    color: white;
}

.status-done {
    background: linear-gradient(135deg, var(--success-green), #34d399); 
    color: white;
}

.status-stuck {
    background: linear-gradient(135deg, var(--danger-red), #f87171);
    color: white;
}

.task-description {
    margin: 10px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.task-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-primary);
}

.task-owner {
    display: flex;
    align-items: center;
    gap: 5px;
}

.owner-avatar {
    width: 20px; /* Adjusted for mobile */
    height: 20px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
}

.task-due-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.progress-bar {
    height: 10px;
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
    margin-top: 12px;
    border: 1px solid var(--border-primary);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-green), var(--accent-cyan)); 
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 6px;
}

.progress-percentage {
    margin-left: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 30px 15px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state-subtext {
    font-size: 0.85rem;
    opacity: 0.7;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    overflow-y: auto; /* Allow scrolling on mobile */
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90vw; /* Adjusted for mobile */
    width: 100%;
    max-height: 80vh; /* Reduced height for mobile */
    overflow-y: auto;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--accent-cyan)); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green); 
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1); 
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.task-detail-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-primary);
}

.task-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    width: 100px; /* Adjusted for mobile */
    color: var(--text-secondary);
    flex-shrink: 0;
}

.detail-value {
    flex: 1;
    color: var(--text-primary);
}

.feedback {
    position: fixed;
    bottom: 16px;
    right: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--success-green), #34d399); 
    color: white;
    border-radius: 10px;
    z-index: 1000;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feedback.show {
    transform: translateX(0);
}

.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--primary-orange));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1000;
    transition: transform 0.3s ease;
}

@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: 300px 1fr; /* Restore two-column layout on larger screens */
        gap: 40px;
    }

    .main-title {
        font-size: clamp(2.5rem, 5vw, 4rem);
    }

    .subtitle {
        font-size: 1.3rem;
    }

    .glass-card {
        padding: 32px;
        border-radius: 24px;
    }

    .stat-item {
        padding: 16px 0;
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        min-width: 120px;
    }

    .group-header {
        padding: 16px 20px;
        border-radius: 16px;
    }

    .task-item {
        padding: 20px;
        border-radius: 16px;
    }

    .modal-content {
        max-width: 500px;
        padding: 32px;
        border-radius: 24px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .close-modal {
        top: 24px;
        right: 24px;
        font-size: 1.5rem;
    }

    .form-input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .task-detail-item {
        gap: 16px;
        margin-bottom: 16px;
        padding: 12px 0;
    }

    .detail-label {
        width: 120px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px 10px;
    }

    .header {
        margin-bottom: 40px;
    }

    .task-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .task-item {
        padding: 12px;
    }

    .task-title {
        font-size: 0.9rem;
    }

    .task-status {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .task-description {
        font-size: 0.85rem;
    }

    .task-due-date {
        font-size: 0.8rem;
    }

    .owner-avatar {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}

html {
    scroll-behavior: smooth;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

select {
    background: var(--bg-primary); 
    color: var(--text-primary); 
    border: 1px solid var(--border-primary); 
    border-radius: 10px; 
    padding: 10px 14px; 
    font-family: 'Inter', sans-serif; 
    font-size: 0.9rem;
    transition: all 0.3s;
    appearance: none; 
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

select option {
    background: var(--bg-primary); 
    color: var(--text-primary); 
    font-family: 'Inter', sans-serif;
    padding: 8px; 
}