.mahak-check-ras-calculator {
    font-family: 'yekanbakh', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 24px;
    max-width: 640px;
    margin: 0 auto;
    direction: rtl;
    transition: all 0.3s ease;
}

.mahak-check-ras-calculator h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a252f;
    margin-bottom: 20px;
    text-align: center;
}

.mahak-check-ras-calculator h4 {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a252f;
    margin: 16px 0 12px;
}

.mahak-check-ras-calculator .form-group-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.mahak-check-ras-calculator .form-group {
    margin-bottom: 0;
}

.mahak-check-ras-calculator label {
    display: block;
    margin-bottom: 2px;
    font-size: 0.69rem;
    font-weight: 400;
    color: #1a252f;
}

.mahak-check-ras-calculator input {
    width: 100%;
    padding: 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 0.75rem !important;
    height: 2.4rem !important;
    font-family: 'yekanbakh', sans-serif;
    background: #f9fafb !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    text-align: right;
    direction: rtl;
}

.mahak-check-ras-calculator input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
    background: #ffffff !important;
}

.mahak-check-ras-calculator input::placeholder {
    color: #94a3b8;
    font-size: 0.7rem;
}

.mahak-check-ras-calculator input[readonly] {
    background: #e5e7eb !important;
    cursor: pointer;
}

.mahak-check-ras-calculator .check-list {
    margin-bottom: 24px;
}

.mahak-check-ras-calculator .check-items {
    display: grid;
    gap: 16px;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    background: #f9fafb;
}

.mahak-check-ras-calculator .check-items::-webkit-scrollbar {
    width: 8px;
}

.mahak-check-ras-calculator .check-items::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.mahak-check-ras-calculator .check-items::-webkit-scrollbar-track {
    background: #e5e7eb;
}

.mahak-check-ras-calculator .check-item {
    display: grid;
    grid-template-columns: 3fr 2fr 1.5fr 48px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mahak-check-ras-calculator .check-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.mahak-check-ras-calculator .add-check,
.mahak-check-ras-calculator #calculate-ras {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.mahak-check-ras-calculator .add-check {
    background: #facc15;
    color: #1a252f;
    margin-bottom: 16px;
}

.mahak-check-ras-calculator .add-check:hover {
    background: #eab308;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.3);
}

.mahak-check-ras-calculator #calculate-ras {
    background: #10b981;
    color: #ffffff;
}

.mahak-check-ras-calculator #calculate-ras:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.mahak-check-ras-calculator .remove-check {
    grid-column: 4 / 5;
    grid-row: 1 / span 3;
    justify-self: end;
    align-self: start;
    width: 32px;
    height: 32px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.10);
}

.mahak-check-ras-calculator .remove-check:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.17);
}

.mahak-check-ras-calculator .remove-check .dashicons {
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.mahak-check-ras-calculator .result {
    margin-top: 20px;
    padding: 16px;
    background: #ecfdf5;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1a252f;
    display: none;
    border-right: 4px solid #10b981;
    text-align: right;
    line-height: 1.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mahak-check-ras-calculator .result.show {
    display: block;
    animation: slideIn 0.4s ease-in-out;
}

.mahak-check-ras-calculator .result p {
    margin: 8px 0;
}

.mahak-check-ras-calculator .error {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 12px;
    padding: 10px;
    background: #fee2e2;
    border-radius: 6px;
    display: none;
    text-align: right;
}

.mahak-check-ras-calculator .error.show {
    display: block;
    animation: slideIn 0.3s ease-in-out;
}

/* هماهنگی با JalaliDatePicker */
.mahak-check-ras-calculator .jdp-container {
    font-family: 'yekanbakh', sans-serif !important;
    direction: rtl !important;
}

.mahak-check-ras-calculator .jdp-container .jdp-header,
.mahak-check-ras-calculator .jdp-container .jdp-body,
.mahak-check-ras-calculator .jdp-container .jdp-footer {
    background: #ffffff;
    border-color: #10b981;
}

.mahak-check-ras-calculator .jdp-container .jdp-day:hover,
.mahak-check-ras-calculator .jdp-container .jdp-day.selected {
    background: #10b981;
    color: #ffffff;
}

@keyframes slideIn {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 767.98px) {
    .mahak-check-ras-calculator {
        max-width: 100%;
        padding: 16px;
    }

    .mahak-check-ras-calculator .form-group-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mahak-check-ras-calculator .check-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto; /* هر فیلد در یک ردیف */
        gap: 12px;
        padding: 16px;
        align-items: stretch;
    }

    .mahak-check-ras-calculator .check-item .form-group {
        margin-bottom: 12px;
    }

    .mahak-check-ras-calculator .remove-check {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        justify-self: end;
        align-self: center;
        width: 28px;
        height: 28px;
        margin: 0;
    }

    .mahak-check-ras-calculator .remove-check .dashicons {
        font-size: 16px;
    }

    .mahak-check-ras-calculator input,
    .mahak-check-ras-calculator button {
        font-size: 0.85rem;
        padding: 8px;
        height: 2.2rem;
    }

    .mahak-check-ras-calculator h3 {
        font-size: 1.15rem;
    }

    .mahak-check-ras-calculator h4 {
        font-size: 0.95rem;
    }

    .mahak-check-ras-calculator .check-items {
        max-height: 360px;
        padding: 12px;
    }

    /* هماهنگی با JalaliDatepicker در موبایل */
    .mahak-check-ras-calculator .jdp-container {
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto;
    }

    .mahak-check-ras-calculator .jdp-container .jdp-body {
        font-size: 0.8rem;
    }
}