/* אקורדיון לחלונית דיאלוג משימה חדשה */
.dialog-section {
    transition: max-height 0.2s, padding 0.2s;
    overflow: hidden;
    max-height: 1000px;
    padding-bottom: 18px;
}
.dialog-section.collapsed {
    max-height: 0;
    padding-bottom: 0;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: linear-gradient(135deg, #e3f0ff 0%, #f7f7f7 100%);
    direction: rtl;
    min-height: 100vh;
}
.container {
    max-width: 900px;
    margin: auto;
    padding: 24px 16px;
}
.section {
    background: #fff;
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: 0 4px 18px rgba(44, 62, 80, 0.10);
    padding: 28px 22px;
    border: 1px solid #e3eafc;
    transition: box-shadow 0.2s;
}
.section:hover {
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.13);
}
.section-title {
    font-size: 1.3em;
    margin-bottom: 18px;
    font-weight: bold;
    color: #2d5be3;
    letter-spacing: 0.5px;
}
.personal-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2d5be3;
}
.personal-form input {
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    background: #f4f8ff;
    font-size: 1em;
    color: #34495e;
    transition: border 0.2s;
}
.personal-form input:focus {
    border: 1.5px solid #2d5be3;
    outline: none;
}
.tasks-list, .messages-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.task-item, .message-item {
    background: linear-gradient(90deg, #e3f0ff 0%, #f7f7f7 100%);
    margin-bottom: 12px;
    padding: 16px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
    border: 1px solid #e3eafc;
    position: relative;
}
.task-item:hover, .message-item:hover {
    background: linear-gradient(90deg, #d0e2ff 0%, #e3f0ff 100%);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.10);
}
.details {
    background: #f4f8ff;
    border-radius: 6px;
    padding: 14px 10px 10px 10px;
    border: 1px solid #e3eafc;
    margin-top: 10px;
    font-size: 0.98em;
    color: #34495e;
    display: none;
    position: relative;
}
.task-item.open .details {
    display: block;
}
.task-btn {
    background: #2d5be3;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    margin-right: 8px;
    margin-left: 2px;
    font-size: 0.97em;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 2px 6px rgba(44,62,80,0.07);
}
.task-btn1 {
    background: #2d5be3;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    margin-right: 8px;
    margin-left: 2px;
    font-size: 0.97em;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 2px 6px rgba(44,62,80,0.07);
}
.task-btn:hover {
    background: #174bbd;
}
.task-btn1:hover {
    background: #174bbd;
}
.section-btn {
    background: #2d5be3;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 1.08em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
    transition: background 0.18s;
    margin-bottom: 0;
    margin-top: 0;
}
.section-btn:hover {
    background: #174bbd;
}

/* דיאלוג משימה חדשה */
.dialog-backdrop {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(44,62,80,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.dialog-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(44,62,80,0.13);
        padding: 32px 28px 22px 28px;
        min-width: 300px;
        max-width: 600px;
        width: 90vw;
    border: 1px solid #e3eafc;
    }

        .dialog-box textarea,
        .dialog-box input[type="text"] {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        }
.dialog-title {
    font-size: 1.18em;
    font-weight: bold;
    color: #2d5be3;
    margin-bottom: 20px;
    text-align: right;
}
.dialog-box label {
    display: block;
    margin-bottom: 7px;
    font-weight: 500;
    color: #2d5be3;
    text-align: right;
}
.dialog-input {
    width: 100%;
    padding: 9px;
    margin-bottom: 16px;
    border: 1px solid #cfd8dc;
    border-radius: 7px;
    background: #f4f8ff;
    font-size: 1em;
    color: #34495e;
    transition: border 0.2s;
}
.dialog-input:focus {
    border: 1.5px solid #2d5be3;
    outline: none;
}
.dialog-box .task-btn {
    min-width: 80px;
    margin-left: 8px;
    margin-right: 0;
}
.dialog-box .task-btn1 {
    min-width: 80px;
    margin-right: 0;
}
.form-row {
    display: flex;
    gap: 32px;
    margin-bottom: 10px;
}
.form-col {
    flex: 1 1 0;
    min-width: 0;
}
.collapse-btn {
    background: none;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    color: #2d5be3;
    padding: 0 4px;
    transition: color 0.18s;
}
.collapse-btn:hover {
    color: #174bbd;
}

/* אייקונים */
.icon-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    margin-right: 2px;
    margin-left: 2px;
    cursor: pointer;
    vertical-align: middle;
    outline: none;
    transition: background 0.15s;
    opacity: 0;
    pointer-events: none;
}
.icon-btn svg {
    display: inline-block;
    vertical-align: middle;
}
.icon-btn:hover svg path[fill="#2d5be3"] {
    fill: #174bbd;
}
.icon-btn:hover svg path[fill="#e74c3c"] {
    fill: #c0392b;
}

/* הצגת כפתורי אייקון רק כשהמשימה פתוחה */
.task-item.open .icon-btn {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.18s;
}

/* פתיחת משימה - שינוי רקע */
.task-item.open {
    background: linear-gradient(90deg, #d0e2ff 0%, #e3f0ff 100%);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.10);
}

/* אקורדיון */
.accordion .section-title {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}
.accordion .section-title::before {
    content: "▼";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 1em;
    color: #2d5be3;
    transition: transform 0.2s;
}
.accordion.collapsed .section-title::before {
    transform: translateY(-50%) rotate(-90deg);
}
.accordion .accordion-content {
    display: block;
    transition: max-height 0.2s;
}
.accordion.collapsed .accordion-content {
    display: none;
}

/* כפתורי עריכה/מחיקה בתוך תיאור המשימה */
.task-actions {
    margin-top: 14px;
    text-align: left;
}
.task-actions .icon-btn {
    opacity: 1;
    pointer-events: auto;
    margin-left: 0;
    margin-right: 0;
    vertical-align: middle;
}
.task-actions .icon-btn:last-child {
    margin-left: 0;
}

/* חלק עליון - טופבר */
.topbar {
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e3eafc;
    padding: 12px 18px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.05);
    margin-bottom: 22px;
    min-height: 56px;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}
.osilogo {
    height: 38px;
    width: auto;
    margin-left: 16px;
}
.product-title {
    font-size: 1.35em;
    font-weight: bold;
    color: #2d5be3;
    margin-left: 18px;
    letter-spacing: 1px;
}
.user-title {
    display: flex;
    align-items: center;
    /* יישור אנכי מדויק */
    height: 38px;
}
.user-title, .user-subscription, .user-expiry, .reminder-summary {
    font-size: 1.08em;
    font-weight: 500;
    color: #34495e;
    padding-right: 8px;
    margin-right: 0;
}
.user-subscription {
    display: flex;
    align-items: center;
}
.user-subscription {
    color: #2d5be3;
}
.user-expiry {
    color: #34495e;
}
.reminder-summary {
    background: #e3f0ff;
    color: #2d5be3;
    padding: 4px 12px;
    border-radius: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}
.user-subscription span:first-child,
.user-expiry span:first-child,
.reminder-summary span:first-child {
    font-weight: 500;
    color: #2d5be3;
    margin-left: 2px;
}
.user-subscription span:last-child,
.user-expiry span:last-child,
.reminder-summary span:last-child {
    color: #34495e;
    font-weight: 400;
}

/* אזור משימות והודעות זה לצד זה בדסקטופ */
.main-flex {
    display: flex;
    gap: 24px;
    flex-direction: column;
}
@media (min-width: 900px) {
    .main-flex {
        flex-direction: row;
        align-items: flex-start;
    }
    #section-2, #section-3 {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* כפתור שדרוג */
#upgrade-btn {
    background: #e67e22;
    color: #fff;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 0.97em;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 2px 6px rgba(44,62,80,0.07);
}
#upgrade-btn:hover {
    background: #d35400;
}

/* התאמה למובייל */
@media (max-width: 600px) {
    .container {
        padding: 8px 2px;
    }
    .section {
        padding: 14px 6px;
    }
    .section-title {
        font-size: 1.1em;
    }
    .task-item, .message-item {
        padding: 12px 7px;
    }
    .dialog-box {
        padding: 18px 8px 12px 8px;
        min-width: 0;
    }
}

@media (max-width: 700px) {
    body, .container, .dialog-box, .accordion-content, .section {
        max-width: 100vw !important;
        width: 100vw !important;
        padding: 0 2vw !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    .topbar {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 10px !important;
        padding: 10px 0 !important;
    }
    #upgrade-btn {
        font-size: 1em !important;
        padding: 8px 18px !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        display: block !important;
    }
    .osilogo {
        width: 48px !important;
        height: auto !important;
        margin-bottom: 6px !important;
    }
    .product-title, .user-title, .user-subscription, .user-expiry, .reminder-summary {
        font-size: 0.98em !important;
        margin-bottom: 4px !important;
    }
    .section-title, .dialog-title {
        font-size: 1.05em !important;
        padding: 8px 0 !important;
        min-height: 38px !important;
        text-align: center !important;
    }
    .dialog-title button[type="button1"] {
        left: 8px !important;
        top: 8px !important;
        transform: none !important;
        position: absolute !important;
        font-size: 1.3em !important;
    }
    .accordion-content, .form-row {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
    }
    .form-col {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 0 !important;
    }
    .dialog-input, input, select, textarea, .big-task-textarea {
        font-size: 0.97em !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding: 8px 6px !important;
        margin-bottom: 8px !important;
    }
    .big-task-textarea {
        min-height: 60px !important;
        resize: vertical !important;
    }
    button, .task-btn, .section-btn, .task-btn1, .icon-btn {
        font-size: 0.97em !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 10px 0 !important;
        margin: 4px 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
        display: block !important;
    }
    .icon-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
    .tasks-list li, .messages-list li {
        font-size: 0.97em !important;
        padding: 8px 4px !important;
        margin-bottom: 6px !important;
    }
    table {
        font-size: 0.95em !important;
        overflow-x: auto !important;
        display: block !important;
        width: 100% !important;
    }
    th, td {
        padding: 6px 2px !important;
        font-size: 0.95em !important;
    }
    /* דיאלוגים */
    .dialog-box {
        max-width: 99vw !important;
        padding: 8px 2vw !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px #e3eafc !important;
    }
    /* גלגלי טעינה */
    #global-loader, #task-loader {
        width: 100vw !important;
        height: 100vh !important;
        padding: 0 !important;
    }
    /* תגיות */
    #answer-tags-container span, #call-tags-container span {
        font-size: 0.95em !important;
        padding: 4px 8px !important;
        margin: 2px !important;
    }
    /* הסתר/הקטן אלמנטים לא קריטיים */
    #subscription-info-tooltip {
        min-width: 180px !important;
        max-width: 90vw !important;
        font-size: 0.95em !important;
        padding: 8px 10px !important;
        right: 0 !important;
    }
    /* טפסים */
    form, .personal-form {
        padding: 0 !important;
        margin: 0 !important;
    }
    .task-actions {
        gap: 6px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    .task-actions .task-btn,
    .task-actions .icon-btn {
        width: auto !important;
        min-width: 40px !important;
        font-size: 0.95em !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center;
    }
    .task-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 12px 7px;
    }
    .task-tags, .task-actions {
        margin-top: 8px;
        justify-content: flex-start;
        max-width: 100%;
    }
}

.big-task-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 260px;
    font-size: 1.58em;
    padding: 18px 16px;
    border-radius: 14px;
    border: 1.5px solid #2d5be3;
    background: linear-gradient(135deg, #e3f0ff 0%, #f7f7f7 100%);
    color: #34495e;
    box-shadow: 0 4px 18px rgba(44,62,80,0.10);
    resize: vertical;
    transition: border 0.2s, box-shadow 0.2s;
    font-family: Arial, 'Segoe UI', sans-serif;
}
.big-task-textarea:focus {
    border: 2px solid #174bbd;
    box-shadow: 0 8px 32px rgba(44,62,80,0.13);
    outline: none;
}
#task-fields-box {
    margin: 18px 0 8px 0;
    padding: 10px 8px;
    background: #f7faff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.07);
}
.task-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 1.08em;
    align-items: center;
}
.task-field-label {
    color: #2d5be3;
    font-weight: 500;
    min-width: 120px;
    display: inline-block;
}
.task-field-value {
    color: #34495e;
    font-weight: 400;
    word-break: break-word;
}
