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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

.user-info {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

#username {
    color: white;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 700;
}

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

/* Main Content */
.main-content {
    display: flex;
    gap: 30px;
    flex: 1;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nav-tabs {
    display: flex;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 5px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    color: #666;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Calendar */
.calendar-container {
    width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    background: #667eea;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.3s;
}

.calendar-nav:hover {
    background: #5a6fd8;
}

#calendar-month {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.day-header {
    text-align: center;
    padding: 10px 5px;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
}

.calendar-day:hover {
    background: rgba(102, 126, 234, 0.1);
}

.calendar-day.today {
    background: #667eea;
    color: white;
}

.calendar-day.selected {
    background: #764ba2;
    color: white;
}

.calendar-day.has-task::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ff6b6b;
    border-radius: 50%;
}

.calendar-day.today.has-task::after,
.calendar-day.selected.has-task::after {
    background: white;
}

/* Content Area */
.content-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.task-list-header h2 {
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
}

.overall-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.overall-progress-bar {
    width: 100px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.overall-progress-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--overall-progress-width, 0%);
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.overall-progress-text {
    font-weight: 600;
    color: #667eea;
    min-width: 35px;
}

/* Task Items */
.task-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    border-left: 4px solid #667eea;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: #28a745;
}

.task-item.completed .task-title {
    text-decoration: line-through;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: #667eea;
}

.task-checkbox.checked {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.task-checkbox.checked::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

.task-content {
    flex: 1;
}

.task-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.task-time {
    color: #666;
    font-size: 0.9rem;
}

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

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
}

.edit-btn {
    background: #17a2b8;
    color: white;
}

.edit-btn:hover {
    background: #138496;
}

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

.delete-btn:hover {
    background: #c82333;
}

/* Add Task Button */
.add-task-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.add-task-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-task-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.add-task-options {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
}

.add-task-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.add-task-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #667eea;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-task-option:hover {
    transform: scale(1.1);
    background: #667eea;
    color: white;
}

/* Chat Interface */
.chat-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.chat-interface.show {
    opacity: 1;
    visibility: visible;
}

.chat-container {
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.chat-interface.show .chat-container {
    transform: scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.bot-message,
.user-message {
    margin-bottom: 15px;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bot-message .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.typing-indicator .message-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.chat-input-container {
    padding: 20px;
    background: white;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: #667eea;
}

#send-task {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

#send-task:hover {
    background: #5a6fd8;
}

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

.task-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.task-modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.task-modal-content label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 500;
    color: #555;
}

.task-modal-content input,
.task-modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.task-modal-content input:focus,
.task-modal-content textarea:focus {
    border-color: #667eea;
}

.task-modal-content textarea {
    resize: vertical;
    height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    justify-content: flex-end;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.form-actions button[type="submit"],
.form-actions button:first-child {
    background: #667eea;
    color: white;
}

.form-actions button[type="submit"]:hover,
.form-actions button:first-child:hover {
    background: #5a6fd8;
}

.form-actions button[type="button"],
.form-actions button:last-child {
    background: #6c757d;
    color: white;
}

.form-actions button[type="button"]:hover,
.form-actions button:last-child:hover {
    background: #5a6268;
}

/* Edit Modal */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.edit-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.edit-modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    height: 80px;
}

/* Stats */
#tasks-tab h3 {
    margin-bottom: 20px;
    color: #333;
}

#tasks-tab p {
    margin-bottom: 10px;
    color: #666;
    font-size: 1rem;
}

#tasks-tab span {
    font-weight: 600;
    color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    .content-area {
        order: -1;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .user-info {
        position: relative;
        justify-content: center;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        font-size: 0.9rem;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .sidebar,
    .content-area {
        padding: 20px;
    }
    
    .task-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .chat-container {
        width: 95%;
        margin: 10px;
    }
    
    .task-modal-content,
    .edit-modal-content {
        width: 95%;
        padding: 20px;
    }
}

.confirm-modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.confirm-modal.show {
  display: flex;
}

.confirm-modal-content {
  background: #fff;
  padding: 20px 25px;
  border-radius: 10px;
  text-align: center;
  width: 300px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  animation: fadeIn 0.2s ease-out;
}

.confirm-actions {
  margin-top: 15px;
}

.confirm-actions button {
  margin: 0 8px;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#confirm-yes {
  background: #27ae60;
  color: #fff;
}
#confirm-yes:hover {
  background: #219150;
}

#confirm-no {
  background: #c0392b;
  color: #fff;
}
#confirm-no:hover {
  background: #a93226;
}

@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}


#task-container {
flex: 1;
overflow-y: auto;
padding-right: 10px;
max-height: calc(100vh - 320px);
margin-right: -10px;
}