
@font-face {
    font-family: 'IRANYekan';
    src: url('IRANYekanXFaNum-Medium.woff2') format('woff2');
      
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekan';
    src: url('IRANYekanXFaNum-ExtraBold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: 'IRANYekan', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    direction: auto;
}

/* RTL/LTR Auto Detection */
[dir="rtl"], [lang="ar"], [lang="fa"], [lang="he"], [lang="ur"] {
    direction: rtl;
}

[dir="ltr"], [lang="en"], [lang="fr"], [lang="de"], [lang="es"] {
    direction: ltr;
}

/* Auto-detect based on content */
.auto-direction {
    direction: auto;
    text-align: start;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
}

.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
    direction: auto;
    text-align: start;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
               0 2px 4px -1px rgba(0, 0, 0, 0.03),
               0 -2px 10px -1px rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 100px;
}

.project-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
               0 2px 4px -1px rgba(0, 0, 0, 0.03),
               0 -2px 10px -1px rgba(255, 255, 255, 0.7);
}



.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 15px;
    cursor: pointer;
    user-select: none;
}

.project-title-area {
    flex: 1;
    display: flex;
    align-items: center;
}

.project-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    border: none;
    background: transparent;
    direction: auto;
    text-align: start;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}




.project-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    border-top: 1px solid var(--border-light);
    /* background: var(--bg-secondary); */
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
}

.project-card.expanded .project-content {
    max-height: 1000px;
    padding: 10px 20px;
    transition: max-height 0.2s ease-in, padding 0.2s ease-in;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}

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

.task-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: var(--bg-primary);
}

.task-checkbox.checked {
    background: #000000;
    border-color: #000000;
}

.task-checkbox.checked::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.task-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    direction: auto;
    text-align: start;
}

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

.task-timer {
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 500;
    margin-left: auto;
}

.task-item .delete-task-btn {
    opacity: 0.5;
    transition: opacity 0.2s ease;
    color: var(--text-tertiary);
    padding: 4px;
    margin-left: 8px;
}


.add-item-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

.floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    font-size: 24px;
}

.floating-btn:hover {
    transform: scale(1.05);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px;
    width: 100%;
    max-width: 640px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: all 0.2s ease;
    direction: auto;
    text-align: start;
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.time-inputs {
    display: flex;
    gap: 12px;
}

.time-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: all 0.2s ease;
}

.time-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.offline-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #f59e0b;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    display: none;
    z-index: 1000;
}

.offline-indicator.show {
    display: block;
}

.expand-icon {
    transition: transform 0.2s ease;
}

.project-card.expanded .expand-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .app {
        padding: 16px 12px;
    }
    
    .floating-btn {
        bottom: 20px;
        right: 20px;
    }
}
