/* Professional To Do List - Styles */

:root {
    /* Color Palette */
    --primary: #2563eb;
    /* Royal Blue */
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --bg-body: #f1f5f9;
    /* Slate 100 */
    --bg-surface: #ffffff;
    --bg-sidebar: #0f172a;
    /* Slate 900 */

    --text-main: #334155;
    /* Slate 700 */
    --text-muted: #64748b;
    /* Slate 500 */
    --text-light: #f8fafc;
    /* Slate 50 */

    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;

    /* Spacing & sizing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* --- Layout --- */

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    /* Slate 400 */
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.nav-item i {
    font-size: 1.2rem;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info .status {
    font-size: 0.75rem;
    color: #94a3b8;
}

.logout-btn {
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--danger);
}

/* Partner Section */
.partner-section {
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-body);
}

/* Auth View */
.auth-wrapper {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.auth-header p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-primary.full-width {
    width: 100%;
}

.btn-primary.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.form-footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0 4px;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 16px;
    min-height: 20px;
}

/* Task View */
.task-view {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

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

.task-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.date-display {
    color: var(--text-muted);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.add-task-container {
    margin-bottom: 24px;
}

.add-task-form {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    padding: 8px 8px 8px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s;
}

.add-task-form:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.icon-start {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-right: 12px;
}

.add-task-form input {
    flex: 1;
    border: none;
    font-size: 1rem;
    padding: 8px 0;
    outline: none;
    background: transparent;
}

/* Task List */
.task-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

.task-list {
    list-style: none;
}

.task-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.task-item.completed .checkbox {
    background-color: var(--success);
    border-color: var(--success);
}

.checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s;
}

.task-item.completed .checkbox::after {
    opacity: 1;
    transform: scale(1);
}

.task-text {
    flex: 1;
    font-size: 1rem;
    color: var(--text-main);
    transition: color 0.2s;
}

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

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    /* Hidden by default on desktop */
    transition: all 0.2s;
}

.task-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
    background-color: #fee2e2;
    /* Red-50 */
}

/* Always show on touch devices or small screens if preferred, 
   but stick to hover for clean desktop look. 
   On mobile, we can make it always visible or rely on long-press?
   Let's make it always visible on mobile for clarity as requested. */
@media (max-width: 768px) {
    .delete-btn {
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 8px;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        inset: 0;
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: block;
    }

    .task-view {
        padding: 24px 16px;
    }

    .header-height {
        font-size: 1.5rem;
    }
}