:root {
    --bg-color: #0f172a;
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(51, 65, 85, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
}

:root {
    /* Modern Color Palette */
    --bg-color: #0f172a;
    --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);

    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --primary-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(51, 65, 85, 0.8);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* Glassmorphism Utilities */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    padding: 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header i {
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    animation: float 3s ease-in-out infinite;
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
}

.error-message:not(:empty) {
    display: block;
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Dashboard */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 2rem;
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-menu span {
    font-weight: 500;
    color: var(--text-primary);
}

.btn-logout {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.task-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.task-controls h2 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.task-controls .btn-primary {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-list {
    display: grid;
    gap: 1.25rem;
}

.task-item {
    background: var(--surface-color);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.task-item:hover {
    transform: translateY(-4px) scale(1.01);
    background: var(--surface-hover);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.task-content {
    flex: 1;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.task-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.task-status {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-desc {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.task-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1.5rem;
    opacity: 0.8;
}

.task-actions {
    display: flex;
    gap: 0.75rem;
    margin-left: 1.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-icon.complete:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Modal */
.modal {
    display: flex;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--surface-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

.modal-actions button {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .app-container {
        padding: 1rem;
    }

    .app-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        border-radius: 16px;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .task-item {
        flex-direction: column;
        padding: 1.25rem;
    }

    .task-actions {
        margin-left: 0;
        margin-top: 1.25rem;
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid var(--surface-border);
        padding-top: 1rem;
    }

    .auth-card {
        padding: 2rem;
    }
}

/* RTL Support */
[dir='rtl'] {
    direction: rtl;
    text-align: right;
}

[dir='rtl'] .task-actions {
    margin-left: 0;
    margin-right: 1.5rem;
}

[dir='rtl'] .task-meta i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir='rtl'] .logo i {
    margin-left: 0.75rem;
    margin-right: 0;
}

[dir='rtl'] #installAppBtn {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir='rtl'] .lang-switch {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

.lang-switch {
    text-align: right;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.lang-switch a {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.lang-switch a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.lang-switch a.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

/* Icon only button style */
.btn-icon-only {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1rem;
}

[dir='rtl'] .btn-icon-only {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}


/* Modal Styles - Responsive for All Screens */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 1rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    position: sticky;
    top: 0;
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    z-index: 10;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close-modal {
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.modal form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    padding-top: 0;
}

.modal-actions button {
    min-width: 100px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1.125rem;
    }

    .modal form {
        padding: 1rem;
    }

    .modal-actions {
        padding: 1rem;
        padding-top: 0;
        flex-direction: column-reverse;
    }

    .modal-actions button {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
        min-height: 100vh;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 4px 4px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Search & Filter Styles */
.task-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--surface-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

[dir="rtl"] .search-box i {
    left: auto;
    right: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

[dir="rtl"] .search-box input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 0.75rem 2rem 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

[dir="rtl"] .filter-group select {
    padding: 0.75rem 1rem 0.75rem 2rem;
    background-position: left 1rem center;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
    }
}

/* Timer Styles */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.btn-start-timer {
    color: var(--success-color);
}

.btn-start-timer:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-stop-timer {
    color: var(--danger-color);
}

.btn-stop-timer:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Delete Animation */
@keyframes deleteTask {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    50% {
        opacity: 0.5;
        transform: translateX(20px) scale(0.95);
    }

    100% {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
        max-height: 0;
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom Scrollbar for Modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 4px 4px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--surface-border);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Subtasks Styles */
.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem;
}

.subtasks-list::-webkit-scrollbar {
    width: 6px;
}

.subtasks-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.subtasks-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    transition: all 0.2s ease;
    animation: subtaskSlideIn 0.3s ease-out;
}

.subtask-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(99, 102, 241, 0.3);
}

.subtask-item.completed {
    opacity: 0.6;
}

.subtask-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.subtask-title {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-word;
}

.subtask-title.completed {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.subtask-delete {
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.subtask-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.subtask-item:hover .subtask-delete {
    opacity: 1;
}

.subtask-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.subtask-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.subtask-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

.subtask-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

#addSubtaskBtn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

#addSubtaskBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#addSubtaskBtn:active {
    transform: scale(0.95);
}

@keyframes subtaskSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.subtask-deleting {
    animation: subtaskSlideOut 0.3s ease forwards;
}

@keyframes subtaskSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        height: 0;
    }
}

/* RTL Support for Subtasks */
[dir='rtl'] .subtask-item:hover {
    transform: translateX(-4px);
}

[dir='rtl'] .subtask-deleting {
    animation: subtaskSlideOutRTL 0.3s ease forwards;
}

@keyframes subtaskSlideOutRTL {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        height: 0;
    }
}

/* Friends Modal Styles */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    border-radius: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.friends-list,
.requests-list,
.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.friend-item,
.request-item,
.user-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.friend-item:hover,
.request-item:hover,
.user-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-placeholder {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* RTL Support for Friends */
[dir='rtl'] .friend-item:hover,
[dir='rtl'] .request-item:hover,
[dir='rtl'] .user-search-item:hover {
    transform: translateX(-4px);
}

/* ============================================
   NOTIFICATIONS STYLES
   ============================================ */

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.notification-item.unread {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.15), transparent);
    border-left: 3px solid var(--primary-color);
}

.notification-message {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* RTL Support for Notifications */
[dir='rtl'] .notification-item:hover {
    transform: translateX(-4px);
}

[dir='rtl'] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--primary-color);
}

[dir='rtl'] .notification-badge {
    right: auto;
    left: -5px;
}

/* ========================================
   Premium Dropdown/Select Styling
   ======================================== */
.form-group select,
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

[dir="rtl"] .form-group select,
[dir="rtl"] select {
    padding-right: 1rem;
    padding-left: 2.5rem;
    background-position: left 1rem center;
}

.form-group select:hover,
select:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background-color: rgba(15, 23, 42, 0.7);
}

/* Dropdown option styling */
.form-group select option,
select option {
    background: #1e293b;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
}

.form-group select:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

/* ========================================
   Chat System Styles
   ======================================== */

.chat-modal-content {
    max-width: 500px;
    height: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.chat-header {
    background: var(--surface-color);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
}

.chat-message {
    display: flex;
    max-width: 80%;
}

.chat-message.sent {
    align-self: flex-end;
}

.chat-message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    max-width: 100%;
}

.chat-message.sent .message-bubble {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received .message-bubble {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-color);
    border-top: 1px solid var(--surface-border);
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.chat-input-area input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
}

.chat-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-empty,
.chat-loading,
.chat-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    gap: 0.75rem;
}

.chat-empty i,
.chat-loading i,
.chat-error i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.chat-error {
    color: var(--danger-color);
}

.chat-btn {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: var(--primary-color) !important;
}

.chat-btn:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    color: #a5b4fc !important;
}

/* RTL support for chat */
[dir='rtl'] .chat-message.sent {
    align-self: flex-start;
}

[dir='rtl'] .chat-message.received {
    align-self: flex-end;
}

[dir='rtl'] .chat-message.sent .message-bubble {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

[dir='rtl'] .chat-message.received .message-bubble {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

[dir='rtl'] .message-time {
    text-align: left;
}

/* Mobile responsive chat */
@media (max-width: 640px) {
    .chat-modal-content {
        height: 80vh;
        max-width: 100%;
        border-radius: 16px;
    }
    
    .chat-message {
        max-width: 90%;
    }
}