/* TaskManager Styles - Professional and Clean */

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

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --gray-light: #ecf0f1;
    --gray-medium: #bdc3c7;
    --gray-dark: #34495e;
    --text-color: #2c3e50;
    --background: #f8f9fa;
    --white: #ffffff;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

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

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

/* Add Task Section */
.add-task {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.add-task h2 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group {
    display: flex;
    gap: 15px;
}

#taskTitle {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--gray-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

#taskTitle:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#addBtn {
    padding: 15px 30px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

#addBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

#addBtn:disabled {
    background: var(--gray-medium);
    cursor: not-allowed;
    transform: none;
}

/* Tasks Section */
.tasks-section {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tasks-section h2 {
    padding: 25px 30px;
    background: var(--gray-light);
    margin-bottom: 0;
    color: var(--text-color);
    font-weight: 500;
    border-bottom: 1px solid var(--gray-medium);
}

/* Tasks List */
.tasks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--gray-light);
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

.task-item:hover {
    background: rgba(52, 152, 219, 0.05);
}

.task-item.completed {
    opacity: 0.7;
    background: rgba(46, 204, 113, 0.05);
}

.task-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-title {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 400;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--gray-dark);
}

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

.btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

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

.btn-complete:hover {
    background: #27ae60;
}

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

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

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

.loading, .error {
    text-align: center;
    padding: 40px 30px;
    font-size: 1.1rem;
}

.loading {
    color: var(--primary-color);
}

.error {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
    margin: 20px 30px;
    border-radius: var(--border-radius);
}

.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: var(--gray-dark);
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: var(--gray-dark);
    border-top: 1px solid var(--gray-light);
}

#apiStatus .status {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status.connected {
    background: var(--secondary-color);
    color: var(--white);
}

.status.error {
    background: var(--danger-color);
    color: var(--white);
}

.status.connecting {
    background: var(--warning-color);
    color: var(--white);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .task-item {
        padding: 15px 20px;
    }
    
    .task-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-small {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}