* {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-family: 'Arial', sans-serif;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* =============== Sidebar =============== */
.sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.new-file-btn {
    width: 100%;
    background: rgba(103, 140, 255, 0.2) !important;
    border: 1px solid rgba(103, 140, 255, 0.3) !important;
    color: #e9ecef !important;
    padding: 0.75rem !important;
    border-radius: 10px !important;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
}

.new-file-btn:hover {
    background: rgba(103, 140, 255, 0.4) !important;
    transform: translateY(-1px);
}

.files-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.files-list::-webkit-scrollbar {
    width: 5px;
}

.files-list::-webkit-scrollbar-track {
    background: transparent;
}

.files-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.file-item:hover {
    background: rgba(103, 140, 255, 0.15);
    border-color: rgba(103, 140, 255, 0.3);
}

.file-item.active-file {
    background: rgba(103, 140, 255, 0.3);
    border-color: rgba(103, 140, 255, 0.6);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.file-name i {
    color: rgba(103, 140, 255, 0.8);
    font-size: 1rem;
}


.file-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

/* .file-edit-btn {
    opacity: 0;
    color: #74b9ff;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.file-item:hover .file-edit-btn {
    opacity: 0.8;
}

.file-edit-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: rgba(116, 185, 255, 0.2);
    color: #0984e3 !important;
}

.file-delete-btn {
    margin-left: 0; 
    opacity: 0;
    color: #ff6b6b;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.file-item:hover .file-delete-btn {
    opacity: 0.8;
}

.file-delete-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
    background: rgba(255, 107, 107, 0.2);
    color: #ff4757 !important;
} */


.file-edit-btn,
.file-delete-btn {
    opacity: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    margin: 0 2px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-item:hover .file-edit-btn,
.file-item:hover .file-delete-btn {
    opacity: 1; 
}

.file-edit-btn:hover {
    background: rgba(116, 185, 255, 0.3);
    transform: scale(1.05);
}

.file-delete-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}


/* =============== Main Content =============== */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: calc(100% - 280px);
    box-sizing: border-box;
}

.form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.input {
    flex: 1;
    min-width: 200px;
    padding: clamp(0.5rem, 2vw, 0.75rem);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e9ecef !important;
    border-radius: 10px;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 0.25rem rgba(103, 140, 255, 0.1) !important;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.add {
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem);
    min-width: 100px;
    border: 1px solid rgba(103, 140, 255, 0.3) !important;
    background: rgba(103, 140, 255, 0.2) !important;
    color: #e9ecef !important;
    border-radius: 10px;
    font-size: clamp(0.875rem, 2vw, 1rem);
    cursor: pointer;
    transition: all 0.3s ease !important;
}

.add:hover {
    background: rgb(1, 14, 53) !important;
    transform: translateY(-2px);
}

.delete-all {
    background: rgba(255, 69, 89, 0.2) !important;
    border: 1px solid rgba(255, 69, 89, 0.3) !important;
    color: #e9ecef !important;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 3vw, 1.5rem) !important;
    min-width: 100px;
    border-radius: 10px;
    font-size: clamp(0.875rem, 2vw, 1rem);
    cursor: pointer;
    transition: all 0.3s ease !important;
}

.delete-all:hover {
    background: rgba(54, 0, 5, 0.91) !important;
    transform: translateY(-2px);
}

.tasks {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 2vw, 1rem);
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.task {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e9ecef;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    position: relative;
    padding-left: 2.5rem !important;
}

.task::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(103, 140, 255, 0.5);
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: togglePop 0.3s ease;
}

@keyframes togglePop {
    0% { transform: translateY(-50%) scale(0.8); }
    50% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}

.task.done {
    opacity: 0.7;
    text-decoration: line-through;
    color: rgba(233, 236, 239, 0.6);
}

.task.done::before {
    background: rgba(103, 140, 255, 0.5);
    border-color: transparent;
    animation: togglePopDone 0.3s ease;
}

@keyframes togglePopDone {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
    100% { transform: translateY(-50%) scale(1); }
}

.task.done::after {
    content: '✓';
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #1a1a2e;
}

.task:hover {
    background: rgba(255, 255, 255, 0.08);
}

.task:hover::before {
    border-color: rgba(103, 140, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.task.done:hover::before {
    background: rgba(103, 140, 255, 0.8);
}

.task:hover{
    cursor: pointer;
}

.btn-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.edit, .del {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.edit {
    background: rgba(103, 140, 255, 0.2);
    border: 1px solid rgba(103, 140, 255, 0.3);
    color: #e9ecef;
}

.edit:hover {
    background: rgb(1, 14, 53);
}

.del {
    background: rgba(255, 69, 89, 0.2);
    border: 1px solid rgba(255, 69, 89, 0.3);
    color: #e9ecef;
}

.del:hover {
    background: rgba(54, 0, 5, 0.91);
}


.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: clamp(1rem, 4vw, 2rem);
    width: 100%;
    max-width: 800px;
    margin: auto;
}

.files-container {
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.file-tab {
    transition: all 0.3s ease;
    user-select: none;
    font-size: 0.9rem;
}

.file-tab:hover {
    background: rgba(103, 140, 255, 0.2) !important;
    transform: translateY(-1px);
}

.file-tab.active-file {
    background: rgba(103, 140, 255, 0.4) !important;
    border-color: rgba(103, 140, 255, 0.6) !important;
}

.add-file-btn {
    margin-right: 0.5rem;
    background: rgba(103, 140, 255, 0.2) !important;
    border: 1px solid rgba(103, 140, 255, 0.3) !important;
    color: #e9ecef !important;
    transition: all 0.3s ease;
}

.add-file-btn:hover {
    background: rgba(103, 140, 255, 0.4) !important;
    transform: translateY(-1px);
}

.add i {
    margin-right: 0.5rem;
}

.delete-all i {
    margin-right: 0.5rem;
}


.task.done i.fa-check {
    opacity: 1;
    color: #1a1a2e;
}
/* Drag and drop visual feedback */
.file-item.drag-over,
.task.drag-over {
    border: 2px dashed rgba(103, 140, 255, 0.8) !important;
    background: rgba(103, 140, 255, 0.1) !important;
    transform: scale(1.02);
}

/* Prevent text selection while dragging */
.dragging {
    user-select: none;
}
/* =============== Responsive =============== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem;
        max-height: 200px;
    }
    .main-content {
        max-width: 100%;
        padding: 1rem;
    }
    .files-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .file-item {
        flex: 0 0 auto;
        max-width: 200px;
    }
    .form {
        flex-direction: column;
    }
    .input, .add, .delete-all {
        width: 100%;
    }
}

/* إضافة دعم للحركة المخفضة */
@media (prefers-reduced-motion: reduce) {
    .add, .task, .delete, .file-item, .new-file-btn {
        transition: none !important;
    }
}


/* Media Queries for different screen sizes */
@media (max-width: 480px) {
    .form {
        flex-direction: column;
    }
    
    .input, .add {
        width: 100%;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .container {
        width: 95%;
    }
}
/* Fix for automatic zoom on mobile when focusing on input fields */
input, select, textarea {
    font-size: 16px !important;
}

@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        width: 90%;
    }
}

@media (min-width: 1025px) {
    .container {
        width: 85%;
    }
}




