/* CSS Design System for ChronActive */
:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #1a1b2f 0%, #0d0e1b 100%);
    --font-primary: 'Outfit', sans-serif;
    --font-rtl: 'Cairo', sans-serif;
    
    --card-bg: rgba(25, 27, 49, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
                   inset 0 1px 0 rgba(255, 255, 255, 0.1),
                   0 0 20px rgba(123, 97, 255, 0.1);
    
    --color-primary: #7b61ff;
    --color-primary-hover: #917cff;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
}

[dir="rtl"] {
    font-family: var(--font-rtl);
}

body {
    font-family: var(--font-primary);
    background: var(--bg-gradient);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
}

.card-3d {
    box-shadow: var(--card-shadow);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-3d:hover {
    transform: translateY(-5px) scale(1.02) rotateX(1deg) rotateY(1deg);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.15),
                0 0 30px rgba(123, 97, 255, 0.2);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Glass Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    border-inline-end: 1px solid var(--card-border);
}

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

.logo-3d {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 15px rgba(123, 97, 255, 0.6);
    letter-spacing: 0.5px;
}

.logo-3d span {
    color: var(--color-primary);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    border-radius: 12px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background: rgba(123, 97, 255, 0.25);
    border: 1px solid rgba(123, 97, 255, 0.4);
    box-shadow: 0 0 15px rgba(123, 97, 255, 0.2);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 1.2rem;
}

.user-name {
    font-weight: 500;
}

.btn-logout {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Main Workspace */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    max-height: 100vh;
}

/* Top Action Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 30px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-select-dropdown, .filter-dropdown, .form-control {
    background: rgba(13, 14, 27, 0.8);
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.dashboard-select-dropdown:focus, .filter-dropdown:focus, .form-control:focus {
    border-color: var(--color-primary);
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 10px;
}

.search-box input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px 15px;
    padding-inline-end: 40px;
    outline: none;
    font-size: 0.95rem;
}

.search-icon {
    position: absolute;
    inset-inline-end: 15px;
    color: var(--color-text-muted);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-3d {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-3d:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Board Board-Container */
.board-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.board-column {
    min-width: 320px;
    max-width: 350px;
    flex: 1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
    /* Mesh Gradients Background preset */
    background: var(--col-gradient);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}

.column-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.task-count {
    background: rgba(123, 97, 255, 0.2);
    color: var(--color-primary-hover);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 100px;
    padding: 5px;
}

/* Task Card style */
.task-card {
    border-radius: 12px;
    padding: 15px;
    cursor: grab;
    user-select: none;
    position: relative;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
}

.task-card:active {
    cursor: grabbing;
}

.task-card.is-syncing {
    opacity: 0.5;
    animation: pulsing 1.5s infinite ease-in-out;
}

.task-card.overdue {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(25, 27, 49, 0.45) 100%);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.task-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0;
}

.task-priority-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-priority-badge.high { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.task-priority-badge.medium { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.task-priority-badge.low { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.task-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

.task-deadline-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-deadline-info.danger {
    color: var(--color-danger);
    font-weight: 600;
}

.task-progress-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Tags in cards */
.task-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Modals */
.modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-wrapper.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 25px;
    max-height: 90vh;
    overflow-y: auto;
}

.task-modal-card {
    max-width: 650px;
}

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

.modal-header h3 {
    margin: 0;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #fff;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

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

.form-row .form-group {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--color-danger);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--color-success);
    color: #a7f3d0;
}

/* Custom Checkbox Grid */
.tags-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s;
}

.tag-checkbox-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tag-checkbox-label input {
    accent-color: var(--tag-color);
}

/* Subtasks & Reminders & Attachments inside modal */
.modal-divider {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 25px 0;
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar-fill {
    background: var(--color-success);
    height: 100%;
    transition: width 0.3s ease;
}

.inline-add-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.inline-add-form input {
    flex: 1;
}

.subtasks-list, .reminders-list, .attachments-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subtask-item, .reminder-item, .attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.subtask-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.btn-delete-item {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
}

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

/* Auth styles */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    padding: 35px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Animations */
@keyframes pulsing {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(0.98); opacity: 0.35; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* Skeleton Loader Styles */
.task-card.skeleton {
    pointer-events: none;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skeleton-title {
    width: 60%;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-badge {
    width: 25%;
    height: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-desc {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-desc.short {
    width: 80%;
}

.skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.skeleton-date {
    width: 40%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

.skeleton-progress {
    width: 20%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* Offline Banner Styles */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.offline-banner.visible {
    transform: translateY(0);
}

.offline-banner .offline-icon {
    animation: blinker 1.5s linear infinite;
}

.offline-banner.online-status {
    background: rgba(16, 185, 129, 0.9);
}

@keyframes blinker {
    50% { opacity: 0; }
}

