/* CSS Variables */
:root {
    --primary-color: #1FAB89;
    --secondary-color: #62D2A2;
    --tertiary-color: #9DF3C4;
    --light-color: #D7FBE8;
    --accent-color: #FF6B9D;
    
    --urgent-important: linear-gradient(135deg, #FF6B9D, #FF8FA3);
    --important-not-urgent: linear-gradient(135deg, #1FAB89, #62D2A2);
    --urgent-not-important: linear-gradient(135deg, #FFB347, #FFCC70);
    --not-urgent-not-important: linear-gradient(135deg, #E0E0E0, #F5F5F5);
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, var(--light-color), #fff);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Navigation */
.nav {
    background: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav .container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 2rem;
    border-radius: var(--border-radius);
    color: white;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card.urgent-important {
    background: var(--urgent-important);
}

.stat-card.important-not-urgent {
    background: var(--important-not-urgent);
}

.stat-card.urgent-not-important {
    background: var(--urgent-not-important);
}

.stat-card.not-urgent-not-important {
    background: var(--not-urgent-not-important);
    color: #666;
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    display: block;
}

/* Eisenhower Matrix */
.matrix-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.matrix-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.eisenhower-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.matrix-quadrant {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    min-height: 300px;
    transition: var(--transition);
    border: 3px dashed transparent;
}

.matrix-quadrant.drag-over {
    border-color: var(--primary-color);
    background: var(--light-color);
    transform: scale(1.02);
}

.matrix-quadrant h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.matrix-quadrant p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.quadrant-tasks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Task Cards */
.task-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: var(--transition);
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.task-card:active {
    cursor: grabbing;
}

.task-card.dragging {
    opacity: 0.7;
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.task-card.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

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

.task-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

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

.task-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    color: #666;
}

.task-btn:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.task-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

.task-deadline.overdue {
    color: #ff4444;
}

.priority-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.priority-high { background: #ff4444; }
.priority-medium { background: #ffaa00; }
.priority-low { background: #44ff44; }

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-tasks h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Analytics */
.analytics-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.analytics-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.analytics-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.completion-rate {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#completion-percentage {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.5s ease;
    border-radius: 6px;
}

#productivity-heatmap {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

#procrastination-insights {
    text-align: left;
    color: #666;
}

.insight-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

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

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

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

/* Forms */
.task-form {
    padding: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-family: inherit;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* FAQ Section */
.faq-section {
    margin: 3rem 0;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid #eee;
}

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

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 0;
    text-align: left;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.6;
    animation: slideDown 0.3s ease;
}

.faq-answer[hidden] {
    display: none;
}

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

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .nav .container {
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .eisenhower-matrix {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .matrix-quadrant {
        padding: 1rem;
        min-height: 250px;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem 0;
    }
    
    .task-card {
        padding: 0.75rem;
    }
    
    .task-title {
        font-size: 0.9rem;
    }
    
    .task-meta {
        font-size: 0.75rem;
    }
    
    .analytics-card {
        padding: 1.5rem;
    }
    
    #completion-percentage {
        font-size: 2.5rem;
    }
}

/* Touch and Haptic Feedback */
@media (hover: none) and (pointer: coarse) {
    .task-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .btn-primary:active,
    .btn-secondary:active,
    .nav-btn:active {
        transform: scale(0.95);
    }
    
    .task-btn:active {
        transform: scale(0.9);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    }
    
    .task-card {
        border: 2px solid #333;
    }
    
    .modal-content {
        border: 2px solid #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .header,
    .nav,
    .modal,
    footer {
        display: none;
    }
    
    .main {
        padding: 0;
    }
    
    .task-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
