/* Govek - Ortak Görev Kontrolü ve Planlama Tasarım Sistemi */

/* Google Fonts - Outfit */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Varsayılan Dark Mode Değişkenleri */
    --bg-main: #0c0f1d;
    --bg-card: rgba(22, 28, 48, 0.7);
    --bg-card-hover: rgba(30, 38, 66, 0.85);
    --bg-sidebar: #0f1426;
    --bg-input: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.09);
    --border-glow: rgba(98, 0, 234, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6200ea;
    --primary-hover: #7c4dff;
    --primary-rgb: 98, 0, 234;
    
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-rgb: 239, 68, 68;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 70px;
    --bottom-nav-height: 64px;
}

/* Light Mod Renk Değişkenleri */
[data-theme-mode="light"] {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-sidebar: #ffffff;
    --bg-input: rgba(0, 0, 0, 0.04);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(98, 0, 234, 0.12);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
}

/* Renk Temaları */
[data-theme="purple"] {
    --primary: #9c27b0;
    --primary-hover: #ba68c8;
    --primary-rgb: 156, 39, 176;
}
[data-theme="blue"] {
    --primary: #0288d1;
    --primary-hover: #29b6f6;
    --primary-rgb: 2, 136, 209;
}
[data-theme="green"] {
    --primary: #00897b;
    --primary-hover: #26a69a;
    --primary-rgb: 0, 137, 123;
}
[data-theme="amber"] {
    --primary: #f4511e;
    --primary-hover: #ff7043;
    --primary-rgb: 244, 81, 30;
}

/* Temel Sıfırlamalar */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
    position: relative;
    overflow-x: hidden;
}

/* Backdrop Overlay for Mobile Drawers */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    height: 100vh;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.logo-text {
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.group-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    user-select: none;
}

.group-item:hover {
    background-color: var(--bg-input);
    color: var(--text-primary);
    transform: translateX(2px);
}

.group-item.active {
    border-left: 3px solid var(--primary);
    background-color: rgba(var(--primary-rgb), 0.12);
    color: var(--text-primary);
    font-weight: 600;
}

.group-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
}

.group-name {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 0.95rem;
}

.group-badge {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-add-group {
    width: 100%;
    padding: 0.75rem;
    border: 1px dashed var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    min-height: 44px;
}

.btn-add-group:hover, .btn-add-group:active {
    background-color: rgba(var(--primary-rgb), 0.1);
    border-style: solid;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.05);
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
    flex-shrink: 0;
}

.user-details {
    overflow: hidden;
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

.btn-footer-action {
    flex: 1;
    padding: 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-footer-action:hover, .btn-footer-action:active {
    color: var(--text-primary);
    background: var(--bg-input);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.main-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background-color: var(--bg-main);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 200;
    flex-shrink: 0;
}

.header-title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.btn-mobile-menu {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 1.25rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Notification Button & Dropdown */
.notification-bell-btn {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.1rem;
    transition: all 0.2s;
}

.notification-bell-btn:hover {
    background: var(--border-color);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--bg-main);
}

.notification-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: modalSlideUp 0.2s ease-out;
}

.notification-dropdown.show {
    display: block;
}

.notification-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    transition: background 0.2s;
}

.notification-item.unread {
    background: rgba(var(--primary-rgb), 0.08);
    border-left: 3px solid var(--primary);
}

.notification-item:hover {
    background: var(--bg-input);
}

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

.notification-text {
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Content Body */
.content-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

/* Group Meta Card & Progress Bar */
.group-meta-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.group-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.group-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.progress-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #10b981);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-avatars {
    display: flex;
    align-items: center;
}

.member-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: 2px solid var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: -8px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.member-avatar-circle:first-child {
    margin-left: 0;
}

.member-avatar-circle:hover {
    transform: translateY(-4px);
    z-index: 10;
}

.group-actions-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Task Form */
.task-form-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 120px;
    gap: 1rem;
    align-items: end;
}

.form-group-task {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-input-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.task-input {
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    min-height: 44px;
}

.task-input:focus {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.03);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.btn-task-action {
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    min-height: 44px;
}

.btn-task-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.btn-task-action:active {
    transform: translateY(0);
}

.btn-ai-assist {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: flex-start;
    transition: all 0.2s;
    min-height: 32px;
}

.btn-ai-assist:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Filter & Search Bar */
.task-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.task-filter-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.task-filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}

.filter-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.filter-count {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}

.task-search-row {
    position: relative;
    width: 100%;
}

.task-search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.task-search-input:focus {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.03);
}

.search-icon-inside {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

/* Task List */
.task-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.2s ease;
    gap: 1rem;
}

.task-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(var(--primary-rgb), 0.25);
    transform: translateY(-1px);
}

.task-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    overflow: hidden;
}

.task-checkbox-wrapper {
    margin-top: 0.2rem;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--primary);
    cursor: pointer;
    accent-color: var(--primary);
}

.task-info {
    flex: 1;
    overflow: hidden;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.35;
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    align-items: center;
}

.task-due {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-input);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

.task-completed-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--success);
    font-weight: 600;
    background: rgba(var(--success-rgb), 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

/* Task Actions (Edit & Delete) */
.task-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-task-icon-action {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-task-icon-action:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.15);
}

.btn-task-icon-action.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(var(--danger-rgb), 0.15);
}

/* Task Status Classes */
.task-item.completed {
    opacity: 0.7;
}

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

.task-item.approaching {
    border-color: rgba(var(--danger-rgb), 0.4);
    background: linear-gradient(90deg, rgba(var(--danger-rgb), 0.08) 0%, transparent 100%);
    animation: criticalPulse 2s infinite alternate;
}

.task-item.approaching .task-due {
    background: rgba(var(--danger-rgb), 0.15);
    color: #ef4444;
    font-weight: 700;
    border-color: rgba(var(--danger-rgb), 0.35);
}

.task-item.overdue {
    border-color: rgba(var(--danger-rgb), 0.6);
    background: rgba(var(--danger-rgb), 0.08);
}

.task-item.overdue .task-due {
    background: rgba(var(--danger-rgb), 0.2);
    color: #ef4444;
    font-weight: 700;
    border-color: rgba(var(--danger-rgb), 0.5);
}

/* AI Panel (Desktop: Right Sidebar / Mobile: Sliding Drawer) */
.ai-panel {
    width: 330px;
    border-left: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

.ai-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-ai {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.ai-icon-pulse {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 2s infinite;
}

.ai-panel-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.ai-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.ai-report-box {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.ai-chat-area {
    display: flex;
    flex-direction: column;
    height: 280px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-main);
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.85rem;
    -webkit-overflow-scrolling: touch;
}

.chat-bubble {
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    max-width: 88%;
    word-break: break-word;
    line-height: 1.45;
}

.chat-bubble.assistant {
    background: var(--bg-card);
    color: var(--text-primary);
    align-self: flex-start;
    border: 1px solid var(--border-color);
}

.chat-bubble.user {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    align-self: flex-end;
}

.ai-chat-input-row {
    display: flex;
    border-top: 1px solid var(--border-color);
    background: var(--bg-sidebar);
}

.ai-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
}

.btn-ai-chat-send {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
}

.btn-ai-chat-send:hover {
    color: var(--primary-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.25s ease-out;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: all 0.2s;
    font-family: inherit;
    min-height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
    background: var(--bg-card);
}

/* Theme Selector Grid */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.theme-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.theme-option:hover {
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.25);
}

.theme-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 auto 0.5rem auto;
}

.theme-dot.default { background-color: #6200ea; }
.theme-dot.purple { background-color: #9c27b0; }
.theme-dot.blue { background-color: #0288d1; }
.theme-dot.green { background-color: #00897b; }
.theme-dot.amber { background-color: #f4511e; }

.theme-option-text {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Mode Switcher Row */
.mode-switcher-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Toast Notification Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 380px;
    width: calc(100vw - 40px);
}

.toast {
    pointer-events: auto;
    padding: 0.85rem 1.25rem;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toastSlideIn 0.3s ease-out;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    backdrop-filter: blur(12px);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast.hide {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Mobile Bottom Navigation Bar (App Navigation) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.nav-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
    user-select: none;
}

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

.nav-tab-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-tab-item.active .nav-tab-icon {
    transform: scale(1.1);
}

.nav-tab-item.center-action {
    position: relative;
}

.nav-tab-item.center-action .center-btn-bubble {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.45);
    transform: translateY(-8px);
    transition: transform 0.2s;
}

.nav-tab-item.center-action:active .center-btn-bubble {
    transform: translateY(-5px) scale(0.95);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state-text {
    font-size: 1rem;
    line-height: 1.5;
}

/* Animations */
@keyframes criticalPulse {
    0% {
        box-shadow: 0 0 4px rgba(var(--danger-rgb), 0.15);
    }
    100% {
        box-shadow: 0 0 16px rgba(var(--danger-rgb), 0.4);
    }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

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

/* Responsive Breakpoints */

/* Tablet (Max 1024px) */
@media (max-width: 1024px) {
    .ai-panel {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        transform: translateX(100%);
        box-shadow: var(--shadow-lg);
        width: 340px;
        max-width: 85vw;
    }

    .ai-panel.open {
        transform: translateX(0);
    }

    .btn-close-ai {
        display: block;
    }

    .task-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .task-form-grid div:last-child {
        grid-column: span 2;
    }
}

/* Mobile Screens (Max 768px) */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        width: 290px;
        max-width: 82vw;
    }

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

    .btn-close-sidebar {
        display: block;
    }

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

    .mobile-bottom-nav {
        display: grid;
    }

    .main-header {
        padding: 0 1rem;
    }

    .content-body {
        padding: 1rem 1rem calc(var(--bottom-nav-height) + var(--safe-bottom) + 1.5rem) 1rem;
        gap: 1.25rem;
    }

    .task-form-grid {
        grid-template-columns: 1fr;
    }

    .task-form-grid div:last-child {
        grid-column: span 1;
    }

    .task-item {
        padding: 0.9rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .task-left {
        width: 100%;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid var(--border-color);
        padding-top: 0.5rem;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-width: 100%;
        animation: modalSlideUp 0.25s ease-out;
        padding-bottom: var(--safe-bottom);
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}
