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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.navbar h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

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

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #c0392b;
}

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

/* Dashboard */
.dashboard {
    margin-bottom: 2rem;
}

.view-selector {
    display: flex;
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.view-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    user-select: none; /* Prevent text selection */
}

.view-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.view-btn.active:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Buckets */
.buckets-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.bucket-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 3px solid #e0e0e0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.bucket-card:hover {
    transform: translateY(-5px);
}

.bucket-header {
    padding: 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bucket-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

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

.bucket-todos {
    padding: 1rem;
    min-height: 200px;
}

/* Todo Items */
.todo-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    transition: all 0.3s ease;
}

.todo-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.todo-item.sortable-ghost {
    opacity: 0.5;
}

.todo-item.sortable-drag {
    transform: rotate(5deg);
}

.todo-content {
    flex: 1;
}

.todo-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.todo-content p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.todo-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.priority, .status, .bucket-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low { background-color: #2ecc71; color: white; }
.priority-medium { background-color: #f39c12; color: white; }
.priority-high { background-color: #e74c3c; color: white; }

.status-pending { background-color: #95a5a6; color: white; }
.status-completed { background-color: #27ae60; color: white; }

.bucket-tag {
    color: white;
}

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

/* Overall View */
.overall-todos {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.overall-todo {
    margin-bottom: 1rem;
    border-left-color: #9b59b6;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Error Page */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
    padding: 2rem;
}

.error-content i {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Bucket Detail View */
.bucket-detail {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.bucket-header-detail {
    padding: 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bucket-header-detail h2 {
    font-size: 2rem;
    font-weight: 600;
}

.bucket-todos-detail {
    padding: 2rem;
    min-height: 400px;
}

.todo-item-detail {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: move;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.todo-item-detail:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.todo-item-detail .todo-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.todo-item-detail .todo-content p {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.todo-date {
    background-color: #ecf0f1;
    color: #7f8c8d;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #95a5a6;
}

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

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
}

/* View Content Containers - Make sure they're properly styled */
.view-content {
    width: 100%;
    min-height: 400px;
}

.view-content.hidden {
    display: none !important;
}

/* Make sure overall view is initially hidden */
#overall-view {
    display: none;
}

/* Debug styles - remove these once working */
.debug-visible {
    border: 2px solid red !important;
    background-color: rgba(255, 0, 0, 0.1) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 0 1rem;
    }
    
    .buckets-container {
        grid-template-columns: 1fr;
    }
    
    .todo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .todo-actions {
        align-self: flex-end;
    }
}

/* Sortable styles */
.sortable-chosen {
    opacity: 0.8;
}

.sortable-fallback {
    display: none;
}
